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://es.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.
Thank you for the reply.
I am not exactly sure why you can’t use INotifyPropertyChanged interface. The interface is part of System.ComponentModel namespace and although it is used in WPF, it is also used in WinForms. The ControlContainerEditor relies on this interface to notify when the EditorControlProperty has changed, so that this change can be propagated to the cell’s value.
If still this interface doesn’t work for you, please describe your scenario and what exactly are you trying to achieve in greater detail and I will be glad to help you achieve it.
I am looking forward to hearing from you.
As the request is changed, this gonna be no question anymore, thanks again for your help.
Hi Richard.
I am still following this thread. Have you had a chance to look at this? If yes, what were the results.
Thank you for using Infragistics Components.
Thank you for the update.
Let me know the results when you are able to test this.
Thanks for replying. I'll try with the INotifyPropertyChanged interface.