DevExpress sets the cell to be uneditable, and selects a cell to select a row

DevExpress sets the cell to be uneditable, and selects a cell to select a row, the purpose is to only display data, and does not provide modification functions:
DevexpressGridControl prohibits clicking on the cell to modify

  1. Set the Editable option of GridView.OptionsBehavior to False. In this case, the entire Grid is read-only.
  2. Change the ReadOnly or AllowEdit properties of the specified column.
  3. Use the ViewingEditor event to prohibit cell editing through the e.Cancel parameter of the event.
  4. Select the cell, select a row:
foreach (GridColumn item in gridView1.Columns)
 {
     item.OptionsColumn.ReadOnly = true;
     item.OptionsColumn.AllowEdit = false;
     //禁止单元格获取焦点
     item.OptionsColumn.AllowFocus = false;
 }
Published 177 original articles · 61 praises · 170,000 views

Guess you like

Origin blog.csdn.net/xingkongtianyuzhao/article/details/104326272