I am using a Gridview and so far everything is working great! My question is how do I make the current row as a read only if a specific condition become false? I have tested and tried a few examples but with no luck. I found a way to make the column read only but im unable to make the entire row read only. Thanks in advance, Irfan
Asked
Active
Viewed 346 times
0
-
1What UI context is this? WinForms? WPF? DevExtreme? Solutions may differ, depending on that. – Fildor Jan 23 '19 at 09:52
-
Possible duplicate of [Can I make row cell value readOnly on XtraGrid just for one row?](https://stackoverflow.com/questions/14011027/can-i-make-row-cell-value-readonly-on-xtragrid-just-for-one-row) – nempoBu4 Jan 24 '19 at 07:39
1 Answers
2
Use event ShowingEditor
.
private void myGridView_ShowingEditor(object sender, System.ComponentModel.CancelEventArgs e) {
var gv = sender as GridView;
if (/* your condition to determine if the row is readokly */ ) {
e.Cancel = true;
}
}

Marko Juvančič
- 5,792
- 1
- 25
- 41