首页 > 其他分享 >GridControl中设置某个单元格不可编辑

GridControl中设置某个单元格不可编辑

时间:2023-02-13 17:47:50浏览次数:45  
标签:控件 绑定 单元格 某个 gridView1 GridControl row

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

相关文章