I have two columns of style DropDownList. I have implemted this like it is advised in another post and example( handling BeforeCellListDropDown- and AfterCellUpdate-events). This works ok so far.
The the first drop-down contains two entries: DayOfWeek or DayOfMonth. If I do so the value list in the second drop-down is filtered properly and the user can choose a DayOfWeek Sunday ... Saturday (0..6) or DayOfMonth (1..31).
After saving the data, when the form comes up the next time, choosen DayOfMonth between 1 and 6 are displayed as DayOfWeek instead. In the drop down list, only 1..31 ist displayed, because this is filtered in the BeforeCellListDropDown event handler. Actually, the cell shows a value that is not in the list.
I set the column style to DropDownValidate in the Grid_InitiallizeLayout event-handler but does not help.
Which is the best way to solve this problem? Shoul I handle another event?
Thanks for any help.
Markus
Hello ,
As far as I understand from your latest post you were able to solve your issue.
Let me know if you have any further questions on this matter.
I guess it is not a good solution writing some tricky code to solve this problem in the UI. I shouls change the underlaying datasource (date table). the value column of the second drop-down should be unique. At the moment only value and foreign key (value of the first drop-down) are unique.
First drop-down columns: { ValidationId : int, Desc: string }
Second drop-down columns: {SecValidationId : int, ValidationId : int, Desc : string }
Best for me seems to be transform the values for Sunday (1) and FirstDayOfMonth (1) using a offset, that these values are unique.