Hi,
I'm on the way to putting custom text box over a cell when it's in edit mode. I have the problem with having the text box put over the cell that has the dropdown list opened.
With a cell that doesn't have a dropdown, putting text box over it is straightforward. On AfterCellEnteredEditMode, the cell actually leaves edit mode and the text box is put over the cell. With a dropdown cell it doesn't work that way, because leaving edit mode also closes the dropdown list, that seems the right thing to do though. However the question remains: how to show the dropdown list opened (UltraComboEditor) and the text box over the textual part of the cell?
I found exiting edit mode before putting custom text box important as otherwise a) the custom text box and the cell will fight who will take focus b) after custom text box updates the value of the cell, the cell is still in edit mode technically and I'm not sure about the further behaviour.
Using editing EditorComponent is not possible for us.
Any guidance would be appreciated.Vitaly
VisitorS said:Using editing EditorComponent is not possible for us.
Sure. I should have been more specific there especially if there was I chance I'm wrong in that statement.
Technically it's possible to use EditorComponent as we migrated to 10.2 version recently. The real reason is that a cell may be pretty complex. For example, it may contain a dropdown and the drilldown button (there are others, let's use drilldown and dropdown in the example), clicking on which invokes some application functionality. Now, some cells support linking (like in Excel). And the custom text box is created for supporting formulas - like formatting, intellisense, mirroring its value with main application fx bar (again, just like in Excel).
As I understood, EditorComponent takes the space of a whole cell, which means that in the case of a cell with both dropdown and drilldown, the editing control must consists of a text field, a drilldown button and a dropdown (in other words the editing control cannot be put only above the textual part of the cell leaving alone the buttons to the right). Am I right? If so, I don't really like the idea to put responsibilities to worry about cells buttons on the text box, especially due to the fact that the text box is reused in other places of the application not only in the grid. Obviously, the user may click the drilldown button on a cell without entering edit mode. That is that functionality is now available from two places - the cell itself and the text box which is the fact I don't like either.
I may be completely wrong here and I hope I am and there is really a simple solution. Also I should mention that I don't like playing around with focus, exiting edit mode when we really in it etc. I will happily use editing EditorComponent if possible.
Hope it all makes sense,-Vitaly
VisitorS said:Is it possible to substitute internally used TextBox by UltraTextEditor with our own TextBox?
No, this is not possible.
VisitorS said:If not, how would you create such an editing control?
I would create a UserControl and put an UltraTextEditor, RichTextBox, or UltraFormatedTextEditor on it and then you could also add as many buttons or dropdowns as you like.
Your UserControl needs to have a property such as Value that deals with the value of the cell in the grid.
Thanks for your responses.
It looks like we don't have other choice than to go with ControlContainerEditor. Let me remind you a problem in couple of words. We have a text box with rich application-specific funtionality that should be used when a cell is in edit mode. The cell may also contain additional buttons that should also be available in edit mode.
UltraTextEditor looks like a good fit here. It has styling, ButtonsRight/Left that simplifies creation of the editing control. Is it possible to substitute internally used TextBox by UltraTextEditor with our own TextBox? If not, how would you create such an editing control?
Thanks,-Vitaly
Hi Vitaly,
You are correct that using the UltraControlContainerEditor would place the responsibility of handling any dropdowns (which are normally handled by the cell itself) on whatever control you were embedding in the cell.
Unfortunately, I don't see any easy way to get the behavior you want be placing a control over the grid. Putting focus onto a TextBox control will cause the grid to exit edit mode and thus close any dropdowns in the cell. There's really no way around that as far as I can see.