导航

XtrGrid 禁用特定单元格

Posted on 2013-02-19 17:38  毅无涯  阅读(156)  评论(0编辑  收藏  举报

using DevExpress.XtraGrid.Views.Grid;
// ...
private void gridView1_ShowingEditor(object sender, System.ComponentModel.CancelEventArgs e) {
   GridView View = sender as GridView;
   string cellValue = View.GetRowCellValue(gridView1.FocusedRowHandle, colCountry).ToString();
   if (cellValue == "Germany")
       e.Cancel = true;
}