We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

GGC Find row index

I am using syncfusion V6.2 grid grouping control. I need to get the total number of records in the grid. the grid for this i am using the following code:
ggc.TableModel.RowCount
I have grouped my grid with one column. The above piece of code works fine when all rows of the grid cell are expanded but when i collapse all rows of the grid or some rows then the row count is not correct. Actually what is happening is it doesn't count the records for collapsed row. Please let me know how to achive this. I want the complete record count irrespective of collapsed or expanded rows.

3 Replies

RC Rajadurai C Syncfusion Team November 9, 2009 08:31 AM UTC

Hi Prabhjeet,

Thanks for your interest in Syncfusion Products.

The total number of records in gridgroupingcontrol can be retrieved through the Table.Records property. This always retrieves the number of records binded in the grid irrespective of its grouping state: collapsed or expanded.

ggc.Table.Records.Count


Regards,
Rajadurai


AB abc November 10, 2009 12:17 AM UTC

The above code "ggc.Table.Records.Count" shows the number of records in grid, but i want the exact number of rows used. Please see the attached image with this query. I want all rows that are displayed in the image.
As per image when we group records there are at least 2 extra rows.



img_7975f2ca.rar


RC Rajadurai C Syncfusion Team November 10, 2009 08:29 AM UTC

Hi Prabhjeet,

If you would like to count the number of rows irrespective of the type it holds. i.e., record, groupcaption, column header, etc., it can be retrieved through the elements count. Here is the code for your reference.

Console.WriteLine(this.gridGroupingControl1.Table.Elements.Count);

This computes the total number of elements present in grid. This count also includes columnheader row. To get rows other than this columnheaderrow, you have to check for the respective element, and calculate count by iterating through the Elements collection in grid.

Regards,
Rajadurai

Loader.
Live Chat Icon For mobile
Up arrow icon