This is a migrated thread and some comments may be shown as answers.

[Solved] Custom Paging With Filter function in Telerik Grid

3 Answers 217 Views
Grid
This is a migrated thread and some comments may be shown as answers.
padmaja
Top achievements
Rank 1
padmaja asked on 21 May 2009, 08:23 AM
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.

  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 
 

3 Answers, 1 is accepted

Sort by
0
Bruno
Top achievements
Rank 2
answered on 26 May 2009, 06:19 AM
You may consider handle the filtering yourself by canceling the filtering command and assigning the filtered data to the grid control. You may find this link helpful.

--Bruno
0
Vasko
Telerik team
answered on 26 May 2009, 06:21 AM
Hello Bruno,


All the best,
Author nickname
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
padmaja
Top achievements
Rank 1
answered on 26 May 2009, 09:56 AM
Thank you very much for your reply. I already finish the code.
Tags
Grid
Asked by
padmaja
Top achievements
Rank 1
Answers by
Bruno
Top achievements
Rank 2
Vasko
Telerik team
padmaja
Top achievements
Rank 1
Share this question
or