Home > Net >  Devpress GridView setting specifies cell editing is prohibited
Devpress GridView setting specifies cell editing is prohibited

Time:01-18

In the actual development needs, according to edit a cell condition is prohibited, so after finishing, stored, for all to share,
The first step 1,
Set in the gridView ShowingEditor event, this event is the cell can trigger when get focus,
2, the second step
Judgment in the event, setting their own judgment conditions, key point is the incoming parameters, e.c. with our fabrication: ancel=true; This sentence can be banned editing ,
Example:
Private void gridView1_ShowingEditor (object sender, CancelEventArgs e)
{
The switch (gridView1. FocusedColumn. FieldName)
{
Case "will" ://specified column
# region is prohibited to edit cell
String mo_no=gridView1. GetFocusedRowCellValue (gridView2. Columns (" to order "))==null? "" : gridView2 GetFocusedRowCellValue (gridView2 Columns [" to order"]). The ToString (). The Trim ();
If (mo_no=="")
{
e.c. with our fabrication: ancel=true;
}
# endregion
break;
}
}
  •  Tags:  
  • C#
  • Related