I’m open for solutions to an issue I’m having when using an UltraCalendarCombo with an UltraGrid ; I have an UltraCalendarCombo as the EditorComponent of an column in an UltraGrid. The columns format property is set to “dd/MM/yyyy”. Since I cannot use the ValidationError event to validate the date being entered, knowing that no events will fire for the UltraCalendarCombo due to the fact it is the EditorComponent of a column in an UltraGrid. Is there a way to analyze the date value being entered by the user? It appears I can access the value and text, but not the actual value entered. Another question is there a way to use an UltraCalendarCombo as the EditorComponent of a grid column and restrict the user from entering data forcing them to use the drop down capabilities of the UltraCalendarCombo. Any advice on both questions is greatly appreciated.
Best Regards.
naizen said:Is there a way to analyze the date value being entered by the user? It appears I can access the value and text, but not the actual value entered.
Typically, you would use the grid's BeforeCellUpdate or BeforeExitEditMode event and examine the Text property of the cell.
The Value property of a cell reads directly from the underlying DataSource. Since you are examining the value before the update occurs, the Value will return the original value before the user changed it. But the Text property of the cell will return the actual text on the screen.
naizen said:Another question is there a way to use an UltraCalendarCombo as the EditorComponent of a grid column and restrict the user from entering data forcing them to use the drop down capabilities of the UltraCalendarCombo. Any advice on both questions is greatly appreciated.
Try setting the Style property on the column to DropDownList. I am not 100% sure, but I think that will work.
Mike, by using the BeforeCellUpdateEvent on the column in question I'm able to validate the date, but the cell never retains the new value, as you know I'm unable to assign the value in the BeforeCellUpdateEvent . How can I assign the new value to the column? If I attempt to assign this new value in the in the AfterCellUpdateEvent the BeforeCellUpdateEvent is then called a second time unnecessarily. Your thoughts please.
Regards.
Hi,
Since there's an error occurring, the user will not be able to leave the cell with the new value, since the new value is not valid. So I assume you are trying to keep the input focus in the cell and not let the user leave until they enter something valid or cancel the change.
If that's the case, then you should probably use BeforeExitEditMode. Cancelling this event will keep the cell in edit mode so the user cannot leave.
If that doesn't work, or you still want to use BeforeCellUpdate, then I think you can set:
e.Cell.EditorResolved.Value to whatever you want.