private void AccountGroup_GridView_ShowingEditor(object sender, CancelEventArgs e) { string colName = AccountGroup_GridView.FocusedColumn.FieldName; int rowIndex = AccountGroup_GridView.FocusedRowHandle; bool isNewRow = AccountGroup_GridView.IsNewItemRow(rowIndex); if (colName == "AccountGroupID" && !isNewRow) { e.Cancel = true; } }
private void AccountGroup_GridView_RowUpdated(object sender, RowObjectEventArgs e) { AccountGroup row = e.Row.CastTo <AccountGroup>(); bool isNewRow = AccountGroup_GridView.IsNewItemRow(e.RowHandle); if (isNewRow) { row.Status = ModifyMode.Insert; return; } if (row.Status == ModifyMode.Insert) { return; } row.Status = ModifyMode.Update; }