Hi,
I have problem with paging in ASP.NET AJAX RadGrid (2009.1). When radgrid is not on first page and I call Rebind() with some narrowing query (result is only one page of records), RadGrid will stuck on non-existent page (eg. Page 11 of 1, Items 110 of 1, Total records 1) and shows NoMasterRecords message.
I must press "go to first page" and then RadGrid starts work correctly. I tried to set RadGrid1.MasterTableView.CurrentPageIndex = 0 after Rebind, but with no luck.
Can you help me? Thank you.
Zdenek
I have problem with paging in ASP.NET AJAX RadGrid (2009.1). When radgrid is not on first page and I call Rebind() with some narrowing query (result is only one page of records), RadGrid will stuck on non-existent page (eg. Page 11 of 1, Items 110 of 1, Total records 1) and shows NoMasterRecords message.
I must press "go to first page" and then RadGrid starts work correctly. I tried to set RadGrid1.MasterTableView.CurrentPageIndex = 0 after Rebind, but with no luck.
Can you help me? Thank you.
Zdenek
| Protected Sub RadToolBar1_ButtonClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadToolBarEventArgs) Handles RadToolBar1.ButtonClick |
| Case "search" |
| RadGrid1.Rebind() |
| RadGrid1.MasterTableView.CurrentPageIndex = 0 |
| End Select |
| End Sub |
| Protected Sub ldsLocality_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.LinqDataSourceSelectEventArgs) Handles ldsLocality.Selecting |
| Dim myLocalities = From loc In dc.Localities Order By loc.Customer.Name, loc.Name Select loc |
| 'Search |
| Dim serachString As String = String.Empty |
| Dim searchTextBox As RadTextBox = CType(CType(RadToolBar1.FindButtonByCommandName("searchText"), RadToolBarButton).FindControl("txtSearch"), RadTextBox) |
| If searchTextBox IsNot Nothing AndAlso searchTextBox.Text <> String.Empty Then |
| myLocalities = myLocalities.Where(Function(q) _ |
| q.CustomerID.ToString.Contains(searchTextBox.Text.Trim) Or _ |
| q.Comment.Contains(searchTextBox.Text.Trim) Or _ |
| q.Comment2.Contains(searchTextBox.Text.Trim) Or _ |
| q.Name.Contains(searchTextBox.Text.Trim)) |
| End If |
| e.Result = myLocalities |
| End Sub |