hi everybody, i hope somebody help me, i need to do a user control that i can see it in a ultrawingrid, i saw an example with the ricthTextEditor, but i would like read documentation about that task!!!! in fact i need a user control with the ultrawincombo's features embebed in a ultragridcell that i can type in the combo's head
Hi Marco,
You are probably right. My guess is that this is a side effect of that fact that UltraCombo existed as a control before support for Embeddable Editors was implemented in the grid. So it was retro-fitted and made into an editor later. So it might behave a little differently than some of the other editors.
Really, using an EditorControl for a grid column is not the best way to do things in any case. This functionality was implemented as a convenience and to allow you to set the editor on a column at design-time. But creating a control to provide an editor to a column is actually a bit wasteful, since the control itself uses up memory for no reason. The more efficient way to do it is to simply create an Editor of the appropriate type at run time and assign it to the Editor property of the column. This is actually what the EditorControl property does, anyway. It just take the Editor property provided by the EditorControl and uses the editor provided as the Editor of the column.
Hi Mike
I just found your above reply while looking for some information about the Editor property of the UltraCombo implementing the IProvidesEmbeddableEditor. What you state seems perfectly ok for all of the other IProvidesEmbeddableEditor inheritors, but the UltraCombo seems to behave in a slightly different way (correct me if I'm wrong):
when I use the Editor property (which is private on the UltraCombo?, but accessible by explicitly casting the UltraCombo to an IProvidesEmbeddableEditor?), I get an UltraGridComboEditor, which I assign to the Editor property of an UltraGridColumn, then the UltraCombo events fire nevertheless (e.g. the OnBeforeDropDown) after the corresponding events on the EmbeddableEditor. In contrast to the other IProvidesEmbeddableEditor inheritors, the UltraGridComboEditor off the UltraCombo's Editor property seems to be closely linked to it's UltraCombo. Is there an explanation for that, or am I completely wrong? The goal would be to obtain an independent EmbeddableEditor not being linked to the UltraCombo, like with the UltraTextEditor or the UltraCalculatorDropDown.
The reason to use the embeddable editor and not the UltraDropDown/ValueList alternative is that I am using a DataFilter with the editor.
Thanks in advance for any information on that topic.
Marco
FireStorm12 said:Can this be done in a WebGrid?
This is the wrong forum for that. You should post this in the WebGrid forum.
Can this be done in a WebGrid?
If so, where and how do you add and display a User Control or dropdown menu to the TextEditor button?
This is technically possible. You can derive a class from UltraCombo and then assign the EditorControl of a grid column or cell to the derived control. But this probably won't do what you want. The grid doesn't really use the control you give it. What happens with an editor control is that the control implements to IProvidesEmbeddableEditor interface. This interface as only one property which returns an EmbeddableEditorBase. This is a clone of the control's internal editor which the control hands out for use by the grid. So so properties on he control will affect this cloned editor, if you set the property before you assign the EditorControl property of the column. But things like events will not fire on the derived control when the user does things in the grid, because the grid is not using the control.
So whether or not this is viable really depends on why you are deriving your own control and what you want it to do in the grid.