【发布时间】:2013-12-30 07:59:04
【问题描述】:
我使用GridView,作为第一列我有一个CheckBox - 通过选择这个CheckBox,它的行应该被保存到数据库中:
foreach (DataGridViewRow row in grid_stock.Rows)
{
c = grid_stock.Rows[i].Cells[0];
b = c.EditedFormattedValue == null ? false : bool.Parse(c.EditedFormattedValue.ToString());
if (b != true)
{
c.Value = true;
//here i am inserting the data to sql.,
}
else
{
c.Value=false;
}
}
但是在这里我没有进入循环,它没有正确检查 GridView 中的检查项目...
【问题讨论】: