When using the online demo for alpahbetic paging in the Rad Grid, when I click the edit button for the 3rd record on the "P" page the grid opens the edit for the 3rd record on the "A" page.
The stored Procedure is basically the "SELECT * FROM [People] WHERE [Name] LIKE @Letter"
<asp:SqlDataSource ID="SqlDataSource1" runat="server" |
ConnectionString="<%$ ConnectionStrings:SiteSqlServer %>" |
SelectCommand = "GetSeminarSpeakers" SelectCommandType="StoredProcedure"> |
<SelectParameters> |
<asp:Parameter Name="Letter" DefaultValue="%" /> |
</SelectParameters> |
</asp:SqlDataSource> |
Protected Sub rgSpeakers_ItemCommand(ByVal source As Object, ByVal e As Telerik.WebControls.GridCommandEventArgs) Handles rgSpeakers.ItemCommand |
Dim value As String = Nothing |
Select Case e.CommandName |
Case ("alpha") |
value = String.Format("{0}%", e.CommandArgument) |
Exit Select |
Case ("nofilter") |
value = "%" |
Exit Select |
End Select |
Me.SqlDataSource1.SelectParameters("Letter").DefaultValue = value |
rgSpeakers.Rebind() |
End Sub |
Protected Sub rgSpeakers_ItemCreated(ByVal sender As Object, ByVal e As GridItemEventArgs) Handles rgSpeakers.ItemCreated |
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(" ") |
linkButton1.Text = "" + ChrW(i) |
linkButton1.CommandName = "alpha" |
linkButton1.CommandArgument = "" + ChrW(i) |
pagerItem.PagerContentCell.Controls.Add(linkButton1) |
pagerItem.PagerContentCell.Controls.Add(lc) |
Next i |
Dim lcLast As New LiteralControl(" ") |
pagerItem.PagerContentCell.Controls.Add(lcLast) |
Dim linkButtonAll As New LinkButton |
linkButtonAll.Text = "All" |
linkButtonAll.CommandName = "NoFilter" |
pagerItem.PagerContentCell.Controls.Add(linkButtonAll) |
End If |
End Sub |