views:

22

answers:

2

Hi all.. I am creating an application in asp.net..I used a grid view to show the datas .. By using the autogenerate columns

I bind the datas to the gridview.. Now i want to make a edit button at the end ..By clicking that the user can edit their details ...

But i need to count the number of columns in a row to make a pop up window to edit the details.. How to find out the number of columns in a autogenerated grid..Number of columns varies depend upon the user..So how to find the number of columns..

+2  A: 
naval
+1  A: 

You can find,
How many columns are in gridview with

GridView1.Columns.Count

How many cells are in one row of gridview with

GridView1.Rows[..].Cells.Count

Best Regards
Myra

Myra