Skip to content

DevExpress-Examples/asp-net-web-forms-grid-editor-readonly-based-on-grid-state

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grid View for ASP.NET WebForms - How to conditionally make cell editors read-only

Implementation Details

This example demonstrates how to set a grid cell editor's ReadOnly property based on the grid's state. The example application allows you to edit a field value in a new row, but the editor becomes read-only when you try to edit an existing row.

The ReadOnly property is set in the ASPxGridView.CellEditorInitialize event handler based on the value of the IsNewRowEditing property.

protected void gridView_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e) {
	ASPxGridView grid = sender as ASPxGridView;
	if (e.Column.FieldName == "CategoryID")
		e.Editor.ReadOnly = !grid.IsNewRowEditing;
}

Files to Look At

Documentation

More Examples

Does this example address your development requirements/objectives?

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

About

Make ASPxGridView cell editors read-only based on the grid's state.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •