Hi all
I am stuck maintaining some old code which uses Infragistics 2005.3. Can't upgrade for the time being for unrelated reasons, and I can't find any documentation for controls this old.
Anyway, I'm having issues with getting a checkbox in an UltraGrid to check when it's clicked in the grid.
There are two boolean columns in the underlying DataTable. Each corresponds to a column on the grid.
Setting the value in the underlying DataTable to true/false makes the checkbox GUI check/uncheck
However, clicking checkboxes in the grid does not update the underlying DataTable, and also does not actually show a check in the checkbox at all - it is as if the control is read-only (not greyed out, however.)
Is there some piece of voodoo necessary to allow the checkboxes to be updated that I don't know about? And I presume I am correct in assuming that once I do manage to get the checkboxes reacting to mouse clicks that the underlying DataTable will be correctly updated?
Kind regards
Tom
Hi Tom,
There's nothing specific to CheckBox columns, but a column in the grid can be read-only for a number of reasons. Here's a KB article that describes all the ways you can disable updating the grid - perhaps this will help you find the code that is causing the issue: HOWTO:How can I make a grid or a column, row, or cell in the UltraWinGrid disabled or read-only?
Another thing to check is... if you are loading a layout or a Preset into the grid, these settings could be getting set that way.
Hi Mike
Thanks for the pointer. Turns out this was set at some point aeons ago:
this.ultraGrid1.DisplayLayout.Override.AllowUpdate = DefaultableBoolean.False;
We had subclassed the UltraGrid so that we can enforce a common look-and-feel for our controls, and also to insulate ourselves from the effects of any breaking changes in the controls that you guys might make
(e.g. when we upgraded an Infragistics date time picker from 5.x to 8.3, the value coming out of it had changed (from something like null to DBNull.Value - I forget exactly what), which breaks our UI's validation code)
I had inadvertantly left the AllowUpdate = DefaultableBoolean.False line in the constructor for our subclass, which explains how it was getting set.
ThanksTom
Hm. The default is Defaut, which actually does resolve to true. What is AllowUpdate set to on this line of code before you set it? It must be explicitly set to false somewhere before this line of code is getting hit.
OK, finally solved this. Turns out I needed to explicitly set:
this.profileGrid.DisplayLayout.Override.AllowUpdate = Infragistics.Win.DefaultableBoolean.True;
instead of just assuming that the default would be True.
Thanks
Sorry, spoke too soon. This hasn't actually solved the issue. I'll keep looking...