I'm using the UltraControlContainerEditor to embed one of our custom controls in an ultragrid. The control is used for editing international phone numbers and has two modes, controlled by a ReadOnly property. When editable it displays a combo to select a country, and two text boxes for entering an area code and number. When read only it displays a text box with the number formatted as a standard international phone number. An encoded (as a string) version of the phone number can be set or read via its "Value" property
To implement this in the grid, I've created an UltraControlContainerEditor and two phone number controls, one set to read only, and the other to editable. I've set the rendering control property of the UltraControlContainerEditor to the latter, and the ediing control to the former.
Initially it works quite well, where the property already has a value. If the cell is active it switches to the editable version of the control and allows me to interact with it. If it's not active it displays the formatted version of the phone number.
The problem is when I try to edit it. Changes I make in the editor do not seem to be passed to the underlying data object. I've set breakpoints on both the control's Value property getter and setter, and the relevant property in the underlying class. When I enter a new value, then click on a different cell, I see the following breakpoints hit:
1) Underlying class's getter, returns the original value
2) Editing Control's getter, returns the encoded version of the phone number that I have just changed - this is called twice
3) Underlying class's getter, returns the original value
4) Rendering control's setter, being set to the original value
5) Steps 3 and 4 then repeat
Is there anything I might be doing wrong which could be causing this?
If I do the same sort of test on one of the other properties, a simple text field, I can see that in addition to the property gets being called on the underlying object, property sets are called as well, setting the new value. It seems to be the lack of these property sets that is causing the problem?
Hello,
I am glad to hear that you have been able to find the information which you need.
Thank you for using Infragistics Components
Ah, belay that - the answer was posted in this thread : http://blogs.infragistics.com/forums/p/47948/255529.aspx#255529