Row count counting headers

Hi,


If the grid has any column it will return +1 in row count.


See the following project (https://www.mediafire.com/file/alw2cr9mk5xztqp/WindowsFormsApp11.rar/file )


1 Reply

DM Dhanasekar Mohanraj Syncfusion Team May 5, 2022 02:43 PM UTC

Hi Diogo,

You can achieve your requirement using below code snippet,

C#:

void ShowRowCount(SfDataGrid sender)

{

    if(sender.View == null)

        MessageBox.Show("Row count: " + sender.RowCount);

    else

        MessageBox.Show("Row count: " + sender.View.Records.Count);

}

 


Note: SfDataGrid.Rowcount returns entire row counts in this case column header also consider as row.

In SfDataGrid.View.Records.Count returns only records count.


Please check this and revert us if you need further assistance for this.


Regards,

Dhanasekar M.


Attachment: WindowsFormsApp11_1a2f1d0b.zip

Loader.
Up arrow icon