We use the UltraDateTimeEditor and we have our own overrides on this control and I was wondering to what extent the WinGrid uses the editor control. We were hoping that by setting the editor control we would be able to save time re-doing validations in the grid's cell events and just let the editor control handle these validations that we already have done.
From what I understand so far, by setting the editor control it does not use the editor control's events. If it is possible to let the editor control run its own events and overrides instead of using the grid cell events please let me know how.
Thanks!
It's not really possible to get the editor to run all of its events through the control when you put it in something like the grid. The reason for this is that all of the editors run events and check their behavior through the Owner infrastructure, which is in this case the grid. In your standalone control, the owner is the control itself, but when you assign the control as the EditorControl of a column, a clone of the editor is passed off to the column, initialized with the various default settings of the control. You will need to interact with the grid's events in this case, possibly refactoring some of your code, since I don't think there's a way to create a derived owner; the grid uses an internal class as its EditorOwner.
-Matt
Thanks for the reply.
After realizing that I can't use our custom controls the way I had hoped I found a solution that allows me to overlay my control on top of the cell so that it looks like it is inside the cell.
Everything seems to work fine except for when I have the template Add Row enabled. When our custom date control fires the ValueChanged event it sets the value of the cell that we are editing.
The issue comes when setting the value of the cell does not do the same thing as normally going into the template add row and typing in the cell.
Is there a way programatically that we can do exactly as the template add row does when you start typing into a cell. Setting the value and have the template add row revert to an addrow.
Thanks.