Data Grid Problem...

pad

Member
Joined
Jan 18, 2005
Messages
14
Programming Experience
5-10
Hi...
How to get the Total No. of rows and columns avail in the datagrid...?

Probably my data grid filled with nearly 100 rows and 15 columns. But i don't know the exact no. Data grid fill the values from database. So i would like to get the total no. of rows and cols in the data grid

Need quick reply.

Tx in advance
 

TPM

Well-known member
Joined
Dec 7, 2004
Messages
623
Location
CA
Programming Experience
3-5
Use : .visiblerowcount and .visiblecolumncount

TPM
 

Paszt

Staff member
Joined
Jun 3, 2004
Messages
1,500
Location
Raleigh, NC - USA
Programming Experience
Beginner
If all the rows and columns aren't visible, that won't give you the total number.
I would look at the dataSource and use the Count property of the dataTable.Rows and DataTable.Columns properties.
 

TPM

Well-known member
Joined
Dec 7, 2004
Messages
623
Location
CA
Programming Experience
3-5
If he doesn't know how many columns he has then he I doubt he's using table styles or has hidden anything. Pad did also say he wanted the row's columns in the DataGrid, Maybe he doesn't want to count hidden coulumns....
 
Top Bottom