Hi, team
I have a question about embed custom controls. And here it is:
I got a custom control CCalendarCombo which inherits from UserControl. It shows in screenshot one.
When I read about this ariticle below, I realized that I need to use ControlContainerEditor.
http://help.infragistics.com/Help/Doc/WinForms/2012.2/CLR4.0/HTML/WinControlContainerEditor_Embed_Any_Control_within_WinGrid_Cell_using_ControlContainerEditor_Object.html
And here is what the ControlContainerEditor source.
In Form1, I used it like this(which is used in the winGrid):
But what it implements is like the screenshot below.
In the second one, I want to click the button to show the calender, but it gives no response.
And the third one, when I input some date value in the controls, it doesn't show the value.
Last one, when focus in the controls it shows the value but when left focus it just like the second one.
Any idea how did this happen? Hopefully you'll help me with that.
Thanks for your concern.
Hi Richard,
Thank you for posting in our forums.
If you want to use a UserControl in an UltraControlContainerEditor you need to define a property in the UserControl, which is used by the cell to get and set its value. You will also need to implement the INotifyPropertyChanged interface to notify the grid that a value has been changed.
Also in your case why do you need a custom user control? UltraCalendarCombo implements IProvidesEmbedableEditor interface so you can use it as a grid editor without needing the additional code to set up control an UltraControlContainerEditor.I have attached a sample which demonstrates this approach.
Please let me know if you have any additional questions.
Hi, Dimitar
Thanks for replying. So I've also asked another one in the forums, here it is:
http://ko.infragistics.com/community/forums/p/95555/472045.aspx
So basicly according to those two answers, that I couldn't use the UltraCalendarCombo because the value I want to show in the Grid couldn't be parsed into DataTime.
Also I couldn't use the custom controls that I implemented, because the project I practiced was using MVP Framework which maybe couldn't use the WPF's INotifyPropertyChanged interface. But the custom controls that I implemented could show the value that I want if not using it in the Grid.
Any idea how to solve this question? Hopefully you could help me with that, thanks a lot.