Skip to content

About

Hide an editor from the edit form dynamically.

Topics

Resources

Stars

0 stars

Watchers

53 watching

Forks

Latest commit

 

History

58 Commits

Folders and files

Repository files navigation

GridView for ASP.NET Web Forms - How to hide an edit form editor based on a column value

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);
    }
}

Files to Review

More Examples

Does This Example Address Your Development Requirements/Objectives?

(you will be redirected to DevExpress.com to submit your response)

About

Hide an editor from the edit form dynamically.

Topics

Resources

Stars

0 stars

Watchers

53 watching

Forks

Used by

Contributors

Languages