Hi,
I wondering how I can put the UltraCellProxy control back into edit mode. Basically, I want to double click on an item in a listbox and want to place it in where the cursor is in the UltraCellProxy. Is this possible?When I go to click in the listbox, the ultracellproxy goes out of edit mode so therefore I cant place anything inside it. I have tried this by a dragdrop event as well, but again, it errors as I am guessing it is not in edit mode. Any help would be great.ThanksChris
Hi Chris,
I'm not sure I understand what you are asking. The UltraGridCellProxy is a control, like any other. So you could call the Actvate or Focus method to the activate it.
Of course, it will exit edit mode if you click on another control that takes focus away.
It almost sounds like you want both control to have focus at the same time, which is not possible.
Hi Mike, An example is I have a standard Windows RichTextbox with a ListBox to the next of it. The user will place the cursor inisde the RichTextBox of where they want they text to be inserted into. And then this is done by double clicking on an item in the listbox control. So basically I am after the same functionality with the cell proxy.I do this insert with the RichTextBox.Paste() function. I know the cell proxy doesn't have this so I don't mind doing the logic to where to the place the (Item) string myself. Or I don't mind using the DragDrop functionality (so dragging the item from the ListBox to the CellProxy) that is associated with the CellProxy object. I hope this sheds more light on the problem?CheersChris
Okay, I see what you mean. I'm not sure how this would work. If you have a single RichTextBox, then it makes sense. but if you have more than one, or a group of TextBoxes, for example, how would you know which TextBox to update? Once you click the ListBox, the TextBox would lose focus and so there's no longer any context for knowing which one to update.
But assuming you only have one UltraGridCellProxy (or one ListBox for each) so there's no ambiguity, the UltraGridCellProxy itself cannot support a Paste method or selection properties because it may be hosting an editor that doesn't support those operations.
I wonder if you could simply use the grid cell, instead of the proxy. The grid cell has a SelectionStart property that will tell you the location of the caret, so that might work. But that might not work, because I don't think the caret position is maintained when the cell leaves edit mode. I'm not sure, you might want to try it out.
Another option would be to use the editor to and try to store the last location of the caret within the proxy. Again, I'm not sure if this is possible, and it would greatly depend on the type of editor being used, so if you need to support a variety of editors, it might increase the amount of code needed. If it's just a single column and it's a regular string column, then it might not be too bad.