Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void userDataGrid_BeginningEdit(object sender, DataGridBeginningEditEventArgs e)
- {
- if ((string)e.Column.Header == "Initials")
- {
- // If this is the new row, entity is not yet attached to the context.
- if (
- (((User)e.Row.Item).EntityState != EntityState.Detached) &&
- (((User)e.Row.Item).EntityState != EntityState.Added))
- {
- e.Cancel = true;
- }
- }
- }
- private void gridData_BeginningEdit(object sender, DataGridBeginningEditEventArgs e)
- {
- if ((string)e.Column.Header == "Doctor ID")
- {
- if (!e.Row.IsNewItem)
- {
- e.Cancel = true;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement