开发者

Grid view - Column

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开发者_如何学C grid..Number of columns varies depend upon the user..So how to find the number of columns..


You will get the no of columns through like this

int NoOfColumns=GridView1.Rows[0].Cells.Count;


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜