GridControl中设置某个单元格不可编辑
对于绑定控件和不绑定控件都有效。因为不绑定控件默认的是文本编辑器。
参考代码示例:
private void gridView1_ShowingEditor(object sender, CancelEventArgs e)
{
if (gridView1.FocusedColumn.FieldName == "PickListID")
{
int row = this.gridView1.FocusedRowHandle;
if (row >=0)
{
if (gridView1.GetRowCellValue(row, "IsPickListEditable") != null)
{
if ((bool)gridView1.GetRowCellValue(row, "IsPickListEditable") == false)
{
e.Cancel = true;//该行不可编辑
}
}
}
}
}
标签:控件,绑定,单元格,某个,gridView1,GridControl,row
From: https://www.cnblogs.com/instr/p/17117162.html