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 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.
Hi, Dimitar
Thanks for your help.
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?
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, Brian Fallon
So basically that I couldn't change the textBox1's size and couldn't click the ultraDateTimeEditor1's dropdown button, is that correct?
Thank you for the reply.
I am not sure if I understand you correctly. The sizes of the Rendering and Editing controls are determined by the size of the column that they are embedded. Still this should allow you to drop down the UltraDateTimeEditor without any issues as the drop down arrow should be always displayed. Keep in mind that the UltraDateTimeEditor will only be displayed once the cell is in edit mode. Also you can control the sizes of the Rendering and Editing control from the width of the column.
Is the dropdown arrow cut-off for you? If yes, please send me a sample and I will be glad to research this further for you.
I am looking forward to hearing from you.
I've got the same question and I'll attach the sample code that I've implement.
My scenario is when the form loaded, the RenderingControl is shown but the when I want to click the drop-down button of the UltraDateTimeEditor,
it just went into edit mode and I couldn't select a date from the calendar and trigger the dateTimeEditor_ValueChanged event.
Could you please help me with that? Thanks a lot.
Hi,
Since your EditingControl is a TextBox, there's no way the DateTimeEditor can ever be dropped down. Once the cell goes into edit mode, the TextBox is used and it has no dropdown, so there's nothing to drop down.
You would have to use a DateTimeEditor as your EditingControl.
In order to enter edit mode and also process the mouse click to drop down a list, you also need to set:
editor.EnterEditModeMouseBehavior = EnterEditModeMouseBehavior.EnterEditModeAndClick;
Did you solve the question raised on May 19th?
Could you please give me a reply as soon as possible,I'm anxious to use it.
Tannk you ver much !!!