After tinkering with this for about 2 hours I've got nothing so here's the problem
I have a form with a grid and a couple ultracomboeditors (A and B). A is assigned to the column as the editorcontrol. In code in the cell activate event I populate B's datasource and then add it to the cell's editorcontrol property. On beforecelldeactivate I remove the cell editorcontrol.
This allows me to filter the contents of B based on the contents of another column. A contains an unfiltered list with all possible options. When the user enters the cell they see only the filtered list. Why use A at all you may ask? Because in A and B the value is a number but I want to display a name, so I need an ultracomboeditor on all rows at all times.
That all works fine except that you have to click on the cell twice to open B's dropdown list. So I'm looking for a way to programmatically open B when the sell is activated. None of the obvious stuff is working. I tried playing with the DropDown method. I tried setting up an event handler on B. I tried setting AllwaysInEditMode to true. What is the right way to do this?
Thanks
Hi Mark,
The approach you are taking is going to have a few problems. I would strongly advise against removing the EditorControl from the cell. The grid needs the editor control in order to convert the value into text and vice versa. If you remove the EditorControl after the user is done editing and the cell has to paint again after that for any reason, it will end up showing the value again.
If you want to filter the list in one column based on another, you need to leave the EditorControl in place. Another option would be for Combo B to contain a list of ALL possible values and then just filter them. This approach is described in great detail (with sample code) here:
Creating a dropdown list in a grid cell whose list values are dependent on another cell - Windows Forms - Infragistics Community
Anyway, the problem you are experiencing with dropping down the list seems to be one of timing. The cell activates and you set it's EditorControl which immediately takes it out of edit mode and then you have to re-enter edit mode to drop it down. A better way to handle this would be to trap for changes in the first column and set the EditorComponent for column B at that point. This is slightly less efficient, of course, since you will be setting the EditorControl even when the user may not enter the other cell. But it will be cleaner and work better.
I know this is very old, but just to let you know that ALL these links are broken since Infragistics decided to wipe out the archives. Again, this is old but still applies and some are still needing answers to the same questions today, but none of the links added to Infragistics support work.
I only see one link in this thread, so I'm not sure what you are referring to when you say "All the links."Anyway, here's an updated link to that article: www.infragistics.com/.../creating-a-dropdown-list-in-a-grid-cell-whose-list-values-are-dependent-on-another-cellBTW... I found that link by simply googling the title from the original URL: "Creating a dropdown list in a grid cell whose list values are dependent on another cell"So if you run into other broken link like this in the future, it's usually pretty easy to find the updated link. :)