C# 单元格值变更事件
作者:互联网
gridPager1.gridView1.CellValueChanged += new DevExpress.XtraGrid.Views.Base.CellValueChangedEventHandler(this.gridView1_CellValueChanged);
private void gridView1_CellValueChanged(object sender, CellValueChangedEventArgs e)
{
if (gridPager1.gridView1.RowCount > 0 && e.RowHandle >= 0)
{
if (gridPager1.gridView1.FocusedColumn.FieldName == "Check" && e.Column.FieldName == "Check")
{
bool isChecked = this.gridPager1.gridView1.GetRowCellValue(e.RowHandle, gridPager1.gridView1.Columns["Check"]).ToBool();
string vender = this.gridPager1.gridView1.GetRowCellValue(e.RowHandle, gridPager1.gridView1.Columns["Vendor"]).ToStr();
if (isChecked)
{
foreach (DataRow item in poTable.Rows)
{
if (item["Vendor"].ToStr() == vender)
{
item["Check"] = true;
}
}
}
}
}
}
标签:gridPager1,CellValueChanged,C#,单元格,item,RowHandle,gridView1,Check,变更 来源: https://www.cnblogs.com/zzzzbk/p/15407951.html