Skip to content

DevExpress-Examples/asp-net-web-forms-grid-initialize-editor-conditionally

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grid for ASP.NET Web Forms - How to initialize an Edit Form editor based on a value of another column

This example demonstrates how to initialize an editor in grid edit form conditionally based on a value of another column.

Grid with a combobox in the edit form

Implementation Details

Follow the steps below to implement this functionality:

  1. Create a custom class that implements the ITemplate interface.
  2. Call the ASPxGridView.GetRowValues method to get current row values.
  3. Create an editor conditionally based on the obtained row values.
  4. Assign the custom template class to the GridViewDataColumn.EditItemTemplate or GridViewTemplates.EditForm property.
  5. To save modified data, handle the RowUpdating event. In the event handler, call the FindEditFormTemplateControl or FindEditRowCellTemplateControl method to obtain a custom editor. Assign editor's value to the corresponding item in the NewValues dictionary.
  6. Handle the CustomColumnDisplayText event to specify text that is displayed in the grid.

Files to Review