I've got the following code (from a project on the site to alphabetize the paging on the grid).
| If Session("AllData") Then |
| If TypeOf e.Item Is GridPagerItem Then |
| Dim pagerItem As GridPagerItem = CType(e.Item, GridPagerItem) |
| pagerItem.PagerContentCell.Controls.Clear() |
| Dim i As Integer |
| For i = 65 To 65 + 25 |
| Dim linkButton1 As New LinkButton() |
| Dim lc As New LiteralControl() |
| lc.Text = " " |
| linkButton1.Text = "" + ChrW(i) |
| linkButton1.CommandName = "alpha" |
| linkButton1.CommandArgument = "" + ChrW(i) |
| pagerItem.PagerContentCell.Controls.Add(linkButton1) |
| pagerItem.PagerContentCell.Controls.Add(lc) |
| Next i |
| End If |
| End If |
I've got a session variable setup, depending on the type of search I either load up the alphabetic pager, or the standard one. The issue is that it always defaults to the standard controls, and as soon as I click a link in the pager it then switches to the alphabetic. And vice versa for the other search option.
So everything works, but I can't figure out how to force the grid pager to paint correctly without clicking on the pager itself.
Thanks.