How do you add a button the pager?

B

Burak Gunay

Hello,

I put this code into the ItemCreated event of my datagrid to ad a
button the pager

If e.Item.ItemType = ListItemType.Pager Then
Dim btn As New Button
btn.CommandName = "SaveApprovals"
btn.Text = "Save"
Dim tc As New TableCell
tc = e.Item.Cells(0)
tc.Controls.Add(btn)
tc.HorizontalAlign = HorizontalAlign.Center
End If

and this created the button but the problem is the pager shows up as

1 2 3 Button

ie.. the page numbers show before the button so I added a line

Dim tc As New TableCell
tc = e.Item.Cells(0)
tc.Controls.Clear() -> this line
tc.Controls.Add(btn)
tc.HorizontalAlign = HorizontalAlign.Center

now only the button shows up but he page numbers don't show up.

How can I add the page numbers after the button? Ideally I'd like to
have the button in the center of the pager and the page numbers at thr
right side of the pager.

Thanks,

Burak
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,737
Latest member
Georgeengab

Latest Threads

Top