Hi.
This is my first post, so please bear with me if I posted it in a wrong place.
I've got a Windows Form with a panel, and on that panel is an UltraGrid. The datasource for the grid is a generic list of KeyValuePair<bool, string>. The column with the bool values are shown as checkboxes in the grid. Only one of the checkboxes should be selected at a time, and they should also be deselectable, which is done programmatically. The string column should not be editable.
When the grid's datasource is set, the values load as expected, but I can't seem to check the checkboxes. I've made a workaround using the DoubleClickCell event, but that really isn't intuitive for checkboxes.
I tried listening to the CellChange event, trying to inspect the Text property of the cell (as described in another post), but the event was never triggered. I've tried explicitly setting the grid's DisplayLayout.Override.AllowUpdate to Infragistics.Win.DefaultableBoolean.True, as described in a KB article. I was expecting this to make the string-column editable also, but still no change.
I hope I've been clear with my problem, and that someone can help me. I'm fairly new to Infragistics altogether so there's a good chance I'm doing something fundamentally wrong :-)
- Lars
I suspected the problem might be the datasource, so I've changed it to a DataTable containing columns with the proper valuetypes. But I still can't get anything from the checkboxes.
Here's a screenshot of my grid:
I figured out (yet another) workaround. When a cell is clicked, I check if it's in the checkbox-column and set the checkmark based on this.
However, this produces som jitters in the GUI, so I would still like to know the proper way to do it :-)
Hi Lars,
The grid columns and cells are editable by default. So if you are unable to edit a cell in the grid, there are essentially two possibilities:
1) Editing is disabled in the grid.
2) Editing is disabled in the data source.
A generic list if KeyValuePair objects is not a good data source to use for data binding in DotNet for a number of reasons, and that would have been my first guess at what was causing the problem here.
But if you are having the same issue using a DataTable, then that's clearly not it. So that means either your DataTable column is read-only or the grid is read-only for some reason.
There are lots of ways to disable editing in the grid on many different levels. So I can't point you to a single place. But here's a KB article that describes all the ways you can disable things in the grid. You can search your code and see if you are doing any of these things:
HOWTO:How can I make a grid or a column, row, or cell in the UltraWinGrid disabled or read-only?
If none of those help, then it must be the DataSource.
Hi Mike,
I briefly looked through the designer and anywhere else that the editing settings could be set, but I couldn't seem to find anything that would disable editing. I'll give it a thoruogh overhaul over the weekend.
But thank you very much for your answer - you are very good at explaining the what the problem is to newcommers like me :-)
I'm gonna mark your reply as the answer, but if I figure out what the problem was, I'll come back and post it.