How do you add a button the pager?

How do you add a button the pager?

Post by Burak Guna » Sun, 15 Jan 2006 00:19:22



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