Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
470
Programmatically make a column editable
posted

I would like the default behavior of my ultragrid to be non-editable (read-only), but allow the user to go into edit-mode for a column.

My attempt did not work. I tried to first make the grid non-editable (the default behavior) with

    myGrid.DisplayLayout.Override.AllowUpdate = DefaultableBoolean.False;

Then I tried to make a particular column editable with the following (this is what doesn't work):

    myGridColumn.CellActivation = Activation.AllowEdit;

I would prefer to keep the default to non-editable (e.g. AllowUpdate = False) and only override the particular column to editable when needed. Is there a way to make it work with this approach? Or am I forced to set AllowUpdate = True, then manually turn off edit for each column until needed?

  • 469350
    Verified Answer
    Offline posted

     Any given cell always uses the least-accessible activation where editing is concerned. So if you set AllowUpdate at the DisplayLayout level, nothing you do will override that setting. So in this case you need to loop through and disable all of the columns except the one you want.