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

COUNT ROWS

Hello
 It is the code for count columns of a grid:
 btnPruebaCB.Text = gvbanks.Columns.Count.ToString();

And I want count rows, I need help with this.

1 Reply

VN Vignesh Natarajan Syncfusion Team April 8, 2019 05:33 AM

Hi Guadalupe, 
 
Thanks for using Syncfusion products. 
 
Query: And I want count rows, I need help with this. 
 
From your query, we understand that you need to get dataSource (rows from datatable) count. We suspect that you are using dataTable to bind it to Grid. To achieve your requirement we suggest you to store the Grid dataSource in variable and get the rows count from that variable. Refer the below code example 
 
 
            DataTable dt = (DataTable)(OrdersGrid.Model.DataSource); // OrdersGrid is the Grid ID 
            var dat = dt.Rows.Count; // get the count from datatable 

Please get back to us if you have further queries.    
 
 
Regards, 
Vignesh Natarajan. 
 


Loader.
Live Chat Icon For mobile
Up arrow icon