How to set the whole xml dataGrid read-only? I am using Binding and no fieldname is specified.Thanks!Seve
Hello Steve,
Yes, there is. I probably forgot to mention it. Now I will be more thorough this time and try to list as many as I can:
1. xamDataGrid.FieldSettings.AllowEdit = false;
2. Use DataPresenterCommans -- xamDataGrid.ExecuteCommand(DataPresenterCommands.EndEditModeAndDiscardChanges);
3. Use EditModeStarting and cancel the event -- e.Cancel = true;
4. Use CellActivating and cancel the event -- e.Cancel = true;
5. Use the EditModeEnding and cancel/revert the old value -- e.AcceptChanges = false;
Alex.
Alex,In winForm ultraGride I just need one line to set whole grid readonly this.ultraGridSummary.DisplayLayout.Override.AllowUpdate = DefaultableBoolean.False;
In xamDataGrid, is there similar property I can use?
Thanks! Steve
Hi Steve,
For example, you can do it in the Loaded event of the XamDataGrid. If you need it earlier -- FieldLayoutInitialized.
Hi Alex,
In which function of code-behind I should put the code in InitialRecord?thanks!
Steve
You can loop through all the Fields in the xamDataGrid.FieldLayouts[0] collection and set the AllowEdit property to False.