I have a pretty simple grid. I have a method where I am setting the activation of each row to Activate Only.
Like this
foreach(var r in ugEqiupment.Rows)
r.Activation = Activation.ActivateOnly
Why would that take so bloody long?
Thanks,
M.
Hello,
You may only have one active row at a time. You can instead, use the 'Selected' property, which will highlight your rows.
foreach (UltraGridRow row in this.ultraGrid1.Rows)
{row.Selected = true;}
The Activation enumeration will help specify what action to take when a single row does indeed become active.
Hi MD,
I am not trying to select the rows...I want to set their activation such that the grid is read only. So am I setting the wrong property? Is there a single setting where I can make the entire grid Read Only but still allow selection of text for copying?
Thanks,M.
e.Layout.Override.AllowUpdate is what I was looking for.
Hi,
I can't see any reason why 90 rows would take any time at all. It might depend on a lot on when you are doing this. If, for example, you run this code before the first time the grid paints, then this will force the creation of the UltraGridRow objects, which means reading all 90 rows from the data source and firing InitializeRow for each row.
It would be more efficient to set the property on the row inside InitializeRow. Or, if you want to disable editing on all rows, just use InitializeLayout and set e.Layout.Override.AllowUpdate.