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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

COUNT ROWS

Thread ID:

Created:

Updated:

Platform:

Replies:

143812 Apr 5,2019 02:33 PM UTC Apr 8,2019 01:33 PM UTC ASP.NET Web Forms 1
loading
Tags: Grid
Guadalupe
Asked On April 5, 2019 02:33 PM UTC

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.

Vignesh Natarajan [Syncfusion]
Replied On April 8, 2019 01:33 PM UTC

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. 
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon