This example demonstrates how to hide an editor from the edit form dynamically.
Use the e.Editor.Visible property in the CellEditorInitialize event handler to control an editor's visibility.
protected void grid_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) {
ASPxGridView gridView = (ASPxGridView)sender;
if (!gridView.IsNewRowEditing) {
Int32 keyValue = (Int32)gridView.GetRowValues(gridView.EditingRowVisibleIndex, new String[] { gridView.KeyFieldName });
if (e.Column.FieldName == "CategoryName")
e.Editor.Visible = (keyValue % 2 == 0);
}
}
- Default.aspx (VB: Default.aspx)
- Default.aspx.cs (VB: Default.aspx.vb)
(you will be redirected to DevExpress.com to submit your response)
