I have a RadGrid performing some timesheet functionality with two columns StartTime and StopTime which are both GridViewDateTimeColumn. A person gets a StartTime when they clock in and a StopTime when they clock out. When the RadDateTimeEditor is initialized, I'm setting it to ShowUpDown and a custom time format since it displays time only. I'm also setting restrictions that the minValue of the StopTime equals the current value of the StartTime (since you can't clock out before you clock in). You can see the attached code for specifics. The problem is situations can occur where there is no valid StopTime. For example, if someone has a StartTime of 11:15 AM and then tries to set the StopTime, the editor will set the NullValue and MinValue of the StopTime to 11:15 AM. The step arrows for up and down show up, but clicking them does nothing since the value for both is invalid. Clicking down makes the time 10:15 AM, which is invalid and clicking up makes the time 12:15 AM which is also invalid. The numbers themselves never actually show up, but this what I assume is happening. I'm not sure what to do to fix this situation. Basically, the stepper will never work if its current value is null and the MinValue is set to anything in between 11:00 - 11:59AM. Maybe I'm missing something. Any help is appreciated.
private
void
m_rgvTimesheets_CellEditorInitialized(
object
sender, GridViewCellEventArgs e )
{
if
( e.ActiveEditor
is
RadDateTimeEditor )
{
var editor = (RadDateTimeEditor)(e.ActiveEditor);
RadDateTimeEditorElement editorElement = (RadDateTimeEditorElement)editor.EditorElement;
editorElement.ShowUpDown =
true
;
editorElement.CustomFormat =
"h:mm tt"
;
if
( e.Column.Name == ColumnTS_StopTime )
{
var startTime = (DateTime) e.Row.Cells[ColumnTS_StartTime].Value;
editor.NullValue = startTime;
editor.MinValue = startTime;
editor.MaxValue = GetMaxTime( m_rdtpDatePicker.Value );
}
}
}