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

How to display number of rows in a grid after filtering

7 Answers 1016 Views
GridView
This is a migrated thread and some comments may be shown as answers.
test
Top achievements
Rank 1
test asked on 08 Jul 2011, 09:17 AM
Hi,

I'm trying to display the number of rows displayed in a grid after filtering it. I don't find any event that fired after filtering action.

Thanks for your help.

7 Answers, 1 is accepted

Sort by
0
komathi priya
Top achievements
Rank 1
answered on 08 Jul 2011, 11:33 AM
hi,

use the property  AllowPaging="True" PageSize="500" , will display the pages in the grid and items in the grid
0
Accepted
Svett
Telerik team
answered on 13 Jul 2011, 04:01 PM
Hello everyone,

You can achieve the desired behavior through handling the FilterChanged event, where you can get the count of the child rows:

private void radGridView1_FilterChanged(object sender, GridViewCollectionChangedEventArgs e)
{
    int rowsCount = e.GridViewTemplate.ChildRows.Count;
}

Kind regards,
Svett
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Accepted
erwin
Top achievements
Rank 1
Veteran
Iron
answered on 15 Jul 2011, 08:03 AM
Be aware that if you enable grouping, you have to recursively count the ChildRows of every group. At least I don't know any other method.

I use the follwing code in a class that derives from GridView: (2011Q1)

public long GetVisibleRows()
   {
       return this._getVisibleRows(this.MasterTemplate.ChildRows);
   }
 
   private long _getVisibleRows(GridViewChildRowCollection rows)
   {
       long i = 0;
       foreach (GridViewRowInfo row in rows)
       {
           if (row is GridViewGroupRowInfo)
           {
               i += this._getVisibleRows(row.ChildRows);
               continue;
           }
 
           i += 1;
       }
       return i;
   }
0
Christ
Top achievements
Rank 2
answered on 30 Sep 2011, 10:26 AM
Thank you! Just what I was looking for...

Christ
0
erwin
Top achievements
Rank 1
Veteran
Iron
answered on 30 Sep 2011, 01:32 PM
Glad I could be of help.
Erwin
0
Ashutosh
Top achievements
Rank 1
answered on 09 Aug 2017, 12:11 PM

Hi,

How can I know a number of rows returned by kendo grid filter on the client side?

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 09 Aug 2017, 12:49 PM
Hello Ashutosh, 

Thank you for writing.  

I would like to note that this forum is related to the Telerik UI for WinForms product. However, it seems that you have a question regarding Kendo UI. Feel free to post your technical questions in the relevant forum: http://www.telerik.com/forums

Thank you for your understanding.

Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
GridView
Asked by
test
Top achievements
Rank 1
Answers by
komathi priya
Top achievements
Rank 1
Svett
Telerik team
erwin
Top achievements
Rank 1
Veteran
Iron
Christ
Top achievements
Rank 2
Ashutosh
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or