I know it's not 'easy' but is it 'possible' to embed a custom UserControl into a child band column of an UltraDataSource object (for display in an Ultra Grid).
When I try it, it doesn't error out but the child band just displays the name of the user control (for the attached screenshot, I'm using a microsoft calendar control but I actually want to use a custom control that displays an UltraMonthViewMulti control).
Hi,
If you want to embed a control in the grid and you have the latest version of NetAdvantage, you could use the new UltraControlContainerEditor component. But this embeds a control in the grid which then gets it's value form the grid cell.
There's no way to embed a control in an UltraDataSource. UltraDataSource has no UI, it's for storing the data. It sounds like you should be storing a date in the UltraDataSource and using the UltraControlContainerEditor in the grid column to display that date.
Thanks for the info., Mike. Now I'm hoping you'll bear with me for a couple more quesitons.
So you're saying the container editor has only been available since the very latest release?
What I'm really wanting to go into and out of the control is a string that represents every day of a given year as a single character. The control would use that information to format the multi-month view control inside the user control. Could I set the datasource up as a string type and pass that string into the user control when the grid is loading?
Actually, you can nix those questions. It looks like 9.2 was the first version, looking at a previous post. We were 9.1 so we went ahead an upgraded to 10.2.
Can you just point me to a sample/example of how to use the new container control? I looked through the editor samples and didn't see anything, unless I overlooked something. However, I'm assuming there's an example somewhere.
You cannot use the same instance of a control for both the RenderingControl and the EditingControl. I assume you mean you are using the same type of control?
There's no reason why you should be getting a stack overflow, unless something in your code is calling itself in an infinite loop.
Perhaps when the value on your control is set, you are updating the UI on your control which sets the value again and it gets into an infinite loop? To avoid that, it's usually a good idea to check in your property setter that the value is actually changing (is not being set to the same value it already was).
Hi Mike,
I the sample, we have only 3 rows loaded with user control. My requirement is similar , but more than 100 cells in grid are loaded with usercontrol. Here same control is used as rendering control as well as editing control. If I keep on moving the mouse for some time, UpdateUI method is throwing stack overflow exeption. Am struck with that now. Please Let me know any alternative way to accomplish my task.
You cannot avoid it. Every time the cell in the grid paints, it will update the RenderingControl with the value from that cell and paint that control into the cell.
Hi Brian,In the ControlContainerEditor C# samples attached , in SameRenderAndEditForm , whenever i move mouse between cells of AddressControl column , set event of Address property in AddressControl is fired.How is that set event related to mouse movement. How to avoid that.
Hi Brian,
In the ControlContainerEditor C# samples attached , in
SameRenderAndEditForm , whenever i move mouse between cells of AddressControl column , set event of Address property in AddressControl is fired.
How is that set event related to mouse movement. How to avoid that.