Making entire UltraGrid Read only

I am populating an UltraGrid with a tableset. I then go to customization and set all of the columns to read only by toggling “Toggle Read Only” and that works well while I am running the customization. If I exit and come back in the columns are not set to read only anymore. Is there a way to make the read only stick? In C# possibly?

I’m pretty sure you can avoid code by either using the ExtendedProperties wizard or changing the properties on the control.

If neither of these work, you can use the wizard to scaffold an event handler for InitializeRow. Inside the event handler, write code similar to:

//note you need to place using Infragistics.Win.UltraWinGrid at top of script

//Example 1 -> set the entire row using this code. I'm pretty sure that works
e.Row.Activation = Activation.NoEdit;

//Example 2 -> I usually set the cells I want as read only like
if (e.Row.Cells.Count != 0) {
     e.Row.Cells["MyColName"].Activation = Activation.NoEdit; 
}

Example 1 did it for me. Thank you for this.

1 Like

I believe you can also do:
grid.DisplayLayout.Override.AllowUpdate = DefaultableBoolean.False;

3 Likes

Thanks guys. I got my issue solved by using the Activation.No Edit.