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

RadGrid: The number of filtered Rows

5 Answers 497 Views
Grid
This is a migrated thread and some comments may be shown as answers.
HananJ
Top achievements
Rank 1
HananJ asked on 09 Dec 2010, 11:10 AM
Hello,
I have faced some problem to get the number of filtered results Auto-fetched by Radgrid, here is my scenario:

I have a radgrid, on its clientRowselected event, the row details will be copied to a text area; it is a control outside the grid, but when i want to filter the results by any criteria, The text area should be cleared, i tried to get the number of filtered results but I couldn't, and RadGrid.Items.Count has a value of the same umber of records without filteration even VirtualItemCount didn't work for me..

Any Idea !

5 Answers, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 09 Dec 2010, 03:19 PM
Hello Hanan,

I suppose you have paging switched on for the grid. This is the reason why RadGrid.Items.Count return one and the same number each time - in fact, it always gets as many items as there are on the current page, usually equal to the page size.

The solution is to temporarily switch paging off (RadGrid1.AllowPaging = false), rebind the grid, get the items count, switch paging back on and rebind the grid again.

Hope it helps.

Greetings,
Tsvetoslav
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
HananJ
Top achievements
Rank 1
answered on 09 Dec 2010, 03:59 PM
Thanks for the reply,
But actually, i have got that when i use filter feature , only the item_created event is fired, in that case where it is supposed to switch on/off the paging and rebind again..

Regards,
0
Accepted
Tsvetoslav
Telerik team
answered on 11 Dec 2010, 10:01 AM
Hi Hanan,

Attached is a small sample.

Greetings,
Tsvetoslav
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
HananJ
Top achievements
Rank 1
answered on 12 Dec 2010, 09:11 AM
It worked finally, Thanks bunches "Telerik Team"
0
HananJ
Top achievements
Rank 1
answered on 12 Dec 2010, 09:12 AM
It worked finally, Thanks bunches "Telerik Team"
Tags
Grid
Asked by
HananJ
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
HananJ
Top achievements
Rank 1
Share this question
or