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,
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.
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?
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.
Hello Mike,
I have a question to ask you. Currently, I have an UltraTextEditor with an EditorButton that drops my user control with the help of the DropDownManager class. The UltraTextEditor is set as the EditorControl of the UltraGridColumn. I need to capture some events, like special keys when the cell is in edit mode but the UltraTextEditor doesn't seem to raise them. Is there a workaround for this or do I have to capture the events at the UltraGrid level?
Thanks in advance for your help.
How do you invoke the method of DropDownManager.DropDown?
Can you show me the example?
Thank you.
You would not use DropDownManager.DropDown. If you want to drop down a list in a grid cell, it depends on what kind of list it is. Typically, you would call PerformAction on the grid.
My EditorControl is a UltraTextEditor with a DropDownEditorButton. I Invoke the method ultraGrid1.PerformAction(EnterEditModeAndDropdown) But the control Can't dropdown.Otherwise,I use the method as follows:
EmbeddableEditorButtonBase baseBtn = ultraGrid1.ActiveCell.EditorResolved as EmbeddableEditorButtonBase; DropDownEditorButton dropBtn = baseBtn.ButtonsRight[0] as DropDownEditorButton; dropBtn.DropDown();
This Mehtod Can make Dropdown but the cell lose the focus,So I must to use DropDownManager,
Now the question is that I Can't get the corrent location for DropDownManager to DropDown.
There's no way to stop this, except what I already said above:
" If you don't want the cell to lose the focus, then you would probably have to use a Control on the DropDownEditorButton that does not accept focus to itself."
I mean I don't want the cell to lose focus,but the control on the DropDownEditorButton gets focus automatically when dropdown. What Can I do?
I'm afraid I don't understand your question. What about it?
How about the Control in DropDownEditorButton getting focus when DropDown automatically?
tidge said:My EditorControl is a UltraTextEditor with a DropDownEditorButton. I Invoke the method ultraGrid1.PerformAction(EnterEditModeAndDropdown) But the control Can't dropdown.
Okay, that's correct. If you are using an DropDownEditorButton, then PerformAction won't work, because the grid doesn't know about the button. That's what I meant above when I said it depends on what kind of button it is.
tidge said:Now the question is that I Can't get the corrent location for DropDownManager to DropDown.
I don't see how DropDownManager will make any difference here. If you are dropping down a control, then the control gets the focus and therefore the cell loses the focus. The DropDownEditorButton already utilizes DropDownManager, so that won't make any difference in terms of focus. If you don't want the cell to lose the focus, then you would probably have to use a Control on the DropDownEditorButton that does not accept focus to itself.