Hi,Recently I'm using UltraDateTimeEditor and TextBox to implement something like DateTimePicker.And as the requests, I've implement the component CCalendarCombo, which with a textbox to cover the display area of the UltraDateTimeEditor controland display the value that's selected. Also I could input with some kind of formatted date that I need to process in the TextChanged event.
Here is what my questions is: I read about how to embed any controls in the WinGrid, and that is to use the property EditorComponent. "columns["No"].EditorComponent = this.cCalendarCombo1;"But with that, I couldn't take the component that I've implemented into the WinGrid.Is there something that I'm missing?
I'll attach the sample solution.Could you help me with that? Thanks for your concern.
Hi, Brian Fallon
Thanks for your help.
So basically that I couldn't change the textBox1's size and couldn't click the ultraDateTimeEditor1's dropdown button, is that correct?
Thanks for your concern.
Q: Is the EditingControl is automatically resized by the ControlContainerEditor to fit the cell it is being displayed in?
A: Yes. It uses the PreferredSize property of the control assigned to the RenderingControl property.
Q: If so, what should I do if I want to select a date from ultraDateTimeEditor1? Is it possible?
A: UltraDateTimeEditor is a dropdown control, and the dropdown calendar does not appear until the dropdown button is clicked. You can programmatically make the dropdown appear by calling the DropDown method.
Hi, Dimitar
As the help link showed, I was trying with the ControlContainerEditor, and here is what I got:
I'm using an UltraDateTimeEditor as the RenderingControl and a TextBox as the EditingControl, then I set the Editor's(class that extends ControlContainerEditor) object to a UltraWinGrid's cell.
Editor editor = new Editor(this.ultraDateTimeEditor1, this.textBox1);
ColumnsCollection columns = this.ultraGrid1.DisplayLayout.Bands[0].Columns;
columns["XXX"].Editor = editor;
What my question is:
Is the EditingControl is automatically resized by the ControlContainerEditor to fit the cell it is being displayed in? If so, what should I do if I want to select a date from ultraDateTimeEditor1? Is it possible?
I just want to add that our UltraCalendarCombo control seems to fit all the requirements here - a textbox-based (non-masked) edit portion, with a dropdown calendar. Furthermore, the dropdown calendar is our own native C# control, where the UltraDateTimeEditor displays a .NET MonthCalendar control, which is a wrapper around the system calendar control.
Hi Richard,
Thank you for posting in our forums.
If you want to show both the TextBox and the UltraDataTimeEditor in the cell, you would need to use the UltraControlContainerEditor. If you don’t use an UltraControlContainerEditor as the editor for the grid column, the grid will display only the UltraDateTime editor and it will remove the textbox. Using the UltraControlContainerEditor, will display both controls. For more information on how to embed a control in the UltraGrid using the UltraControlContainerEditor, please follow this link:
http://help.infragistics.com/Help/Doc/WinForms/2012.2/CLR4.0/HTML/WinControlContainerEditor_Embed_Any_Control_within_WinGrid_Cell_using_ControlContainerEditor_Object.html
Please let me know if you have any additional questions.