Requirements |
|
RadControls version |
2010.1.10.409 |
.NET version |
4.0 |
Visual Studio version |
2010 |
programming language |
C# |
browser support |
all browsers supported by RadControls |
PROJECT DESCRIPTION
I ran into the problem where I needed a column to be read-only after data was entered. In this case, the Zip Code could not change once it was entered by the user.
private void rgLocations_CellBeginEdit(object sender, GridViewCellCancelEventArgs e) |
{ |
if (((GridViewDataColumn)this.rgLocations.CurrentColumn).UniqueName == "Zip Code" && |
this.rgLocations.CurrentRow.Cells["Zip Code"].Value != DBNull.Value) |
{ |
e.Cancel = true; |
RadMessageBox.SetThemeName(this.ThemeName); |
RadMessageBox.Show("You cannot edit zip codes of an existing Location"); |
} |
} |