View Full Version : [solved]Roweditor with 2 datefields, where to validate if they depend on each other

14 Oct 2010, 12:59 AM

I have a roweditor with two datefields which are valid in dependency of each other.
The roweditor is valid if all fields are valid but that cant be determined from one datefield alone.
So it think it would be correct to "validate" in roweditor, but there is no event i could use for that or i m missing something.
The event validateedit (from Roweditor) is fired after validation is already done. I could than cancel the update of my grid here if my validation fails but i m not able to give a validationmessage within the roweditor and leave the roweditor in editmode, so the user can pick a new date.

What i nedd would be a point where i could disable the update button of roweditor until my conditions for the datefields are met. But i dont know where to do it.

Has someone a hint 4 me ? :)

14 Oct 2010, 1:34 AM
You could use the change events of the actual Fields rather than the RowEditor.

14 Oct 2010, 2:31 AM
Ok, i thought about that already, but i dont know how i could know the actual row in the changeevent of datefield.
And if i dont know the row, how could i get the date from the other datefield in the same row to comapre these fields ?

14 Oct 2010, 4:00 AM
I assume you are writing OO.

So capture the Record being edited using the RowEditor's beforeedit event. Store it in a member property of your class for use by the validation member functions.

15 Oct 2010, 12:58 AM
Thx animal.
Dunno why this question rised.
Life can be so easy :)