Hi All,
Am Using Custom Paging in Telerik Grid. To do this custom paging I choosen Need Data Source method. My PageSize was 20. The custom paging process was working good.
But am allowing users to filter all the columns in my telerik grid. When user try to filter data am always getting time out expired. Because for the filter function custom paging was set to false. But I understand that if we implement filter function to telerik grid, the grid needs full set of records to filter. We implement the Custom paging because of grid performance. But when user try to filter again the grid don't have performance.
Could you please advise me how can i implement custom paging when the grid has filter option for each column.
Am Using Custom Paging in Telerik Grid. To do this custom paging I choosen Need Data Source method. My PageSize was 20. The custom paging process was working good.
But am allowing users to filter all the columns in my telerik grid. When user try to filter data am always getting time out expired. Because for the filter function custom paging was set to false. But I understand that if we implement filter function to telerik grid, the grid needs full set of records to filter. We implement the Custom paging because of grid performance. But when user try to filter again the grid don't have performance.
Could you please advise me how can i implement custom paging when the grid has filter option for each column.
| Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.WebControls.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource |
| Dim startRowIndex As Integer = IIf((ShouldApplySortFilterOrGroup()), 0, RadGrid1.CurrentPageIndex * RadGrid1.PageSize) |
| Dim maximumRows As Integer = IIf((ShouldApplySortFilterOrGroup()), AppBusinessHelper.getTotalRecords(Me.radDateFrom.SelectedDate, Me.radDateTo.SelectedDate) ,RadGrid1.PageSize) |
| RadGrid1.AllowCustomPaging = Not ShouldApplySortFilterOrGroup() |
| RadGrid1.DataSource = AppBusinessHelper.getCurrentPageRecords(Me.radDateFrom.SelectedDate, Me.radDateTo.SelectedDate,startRowIndex, maximumRows) |
| End Sub |
| Public Function ShouldApplySortFilterOrGroup() As Boolean |
| Return RadGrid1.MasterTableView.FilterExpression <> "" OrElse RadGrid1.MasterTableView.GroupByExpressions.Count > 0 OrElse RadGrid1.MasterTableView.SortExpressions.Count > 0 |
| End Function |