一个DataGridView有3列private void gvList_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
{
if (e.ColumnIndex == 0)
{}
}第一列的visible为false,在if (e.ColumnIndex == 0)设为断点时,显示的ColumnIndex 的值并没出现为0,而是直接为1,也就无法进入里面的判断语句了。
是否
CellFormatting的ColumnIndex 只针对visible为true的单元格
{
if (e.ColumnIndex == 0)
{}
}第一列的visible为false,在if (e.ColumnIndex == 0)设为断点时,显示的ColumnIndex 的值并没出现为0,而是直接为1,也就无法进入里面的判断语句了。
是否
CellFormatting的ColumnIndex 只针对visible为true的单元格
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货