Hello,
In our application we have implemented a user control that is widely used for presenting and manipulating data (it simply consists of a UltraGrid for displaying the data and an UltraToolbarsManager which provides tools for data manipulating). We are looking for a way to display this user control as a drop down for grid cells that use lookup tables. It would be nice to do that for two main reasons; first, the user will be able to manipulate the data through the user control and, second, to provide a uniform interface for data management in the application.
Having read about the newly added functionality of ControlContainerEditor in version 9.2, we were wondering if this is the right place to start building. We will need of course to pretty much implement (or use, if it's possible) all the UltraDropDown functionality like AutoComplete, support for Value and Display member, keeping the grid cell focused while the user types in and so on.
Any advice about where and how to start will be greatly appreciated.
Hi Mike,
Oh, I see. I didn't realize that the dropdown would close when you click on the cell. I don't see any way to stop this form happening.
my goal is to mimic the behavior of an UltraDropDown. With the UltraDropDown, when you click the drop down arrow, the grid cell goes in edit mode (if it wasn't in edit mode already) and stays in edit mode after the drop down is displayed. Furthermore, if I click inside the grid cell, the drop down doesn't close. I would like the same to happen with my custom drop down.
Experimenting a little, I found out that I can achieve the desired behavior by using the DropDownManager class in order to manually drop my user control. Of course, I need to use an EditorButton instead of a DropDownEditorButton in the UltraTextEditor that I use as EditorControl for the UltraGridColumn and handle the EditorButtonClick event. I had a hard time though providing the necessary parameters for the DropDownManager.DropDown method and I'm not even certain that they are the correct ones.
What do you advise? Should I proceed with the help of the DropDownManager or am I missing something in the easier scenario?
Hi,
I'm not sure I understand what you mean. I assume that if you have a control on the DropDownEditorButton that that control will need to get focus at some point. Even if it doesn't get focus when you drop it down, the user will eventually need to give it focus in order to use it, no?
But I'm not really clear on exactly what you mean by "focus" here. That word ha a lot of different meanings. Are you saying that the ActiveCell in the grid is changing?
Thanks for the quick reply.
I followed your advice and created an UltraTextEditor (with a DropDownEditorButton) that I use as the EditorControl for the column. However, when I click the drop down button and the drop down control is displayed, the focus doesn't stay in the grid cell, even though I set the AutoFocus property of the DropDownEditorButton to false. Furthermore, if I click the cell, the dropped down control is closed.
Is this the standard behavior or am I doing something wrong?
the new UltraControlContainerEditor is for embedding a control directly inside a grid cell. But it sounds like you want your control to show up as a dropdown in the cell, and not actually in the cell itself. In that case, you don't need the new editor. You can already do this without it.
I, and others, ha've gone over this on the forums about a half a dozen times, so rather than re-type it all here, I will refer you to a recent post that explains how to do it. :)
UltraComboEditor - Can I Use a Custom Control for the DropDown? - Infragistics Community
Or, do a search for "DropDownEditorButton" and you will find a whole bunch more along the same lines.