无法计算网格的列数 [英] unable to count columns of a grid
本文介绍了无法计算网格的列数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在asp.net中运行一个程序,我在计算列
但它总是返回0而我的网格包含14列
使用的代码是: -
i = gridview1.columns.count
i am running a program in asp.net in which i am counting columns
but it always return 0 while my grid contains 14 columns
the code i m using is:-
i=gridview1.columns.count
推荐答案
试试这个:
Hi,
Try this:
i = gridview1.Rows[0].Cells.Count;
希望这有帮助。
Hope this helps.
这篇关于无法计算网格的列数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文