Hello,
in my UltraGrid the user should be allowed to add new rows and delete rows but the user should not be able to change data of existing rows.
When I set the property "AllowAddNew" to FixedAddRowOnTop and the property "AllowUpdate" to False the user can't add any new row... It seems like the AllowAddNew depends on the AllowUpdate.
What can I do else?
This seems like an unusual UI. What if the user adds a row and then realizes they made a mistake? They will not be able to edit the row they just added once it becomes a committed row.
But anyway, I got this to work by doing this:
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { e.Layout.Override.AllowAddNew = AllowAddNew.FixedAddRowOnTop; } private void ultraGrid1_AfterRowActivate(object sender, EventArgs e) { UltraGrid grid = (UltraGrid)sender; if (grid.ActiveRow != null && !grid.ActiveRow.IsAddRow) grid.ActiveRow.Activation = Activation.ActivateOnly; }
I know that it sounds unussual but in our case it makes sense. I am already doing it similar to your suggestion but we are managing the most important Grid-Properties from outside by storing them in the database. So we are loading different layouts on runtime and we don't need new program version for small changes. Because of this I believed and hoped that I can just set AllowUpdate on False and AllowAddNew to True and get the result I am searching for...
So the AllowAddNew really depends on the AllowUpdate?
isiraider said:So the AllowAddNew really depends on the AllowUpdate?
It appears so. I could not find any other way to do this.