Hi,
I want to disable end time based on start time selection. i am using listitem in grid
eg: Suppose I select 12:00 from start time dropdown list.
Now in end time before 12:00 all the time should be disable.
how to achieve this through c# ?
Pls help.....
ROhit chaturvediPosted Jul 2, 2015, 4:42 PM
{
foreach ( ListItem item in EndTime.Items )
{
if (DateTime.ParseExact(item.Value.ToString(), "HH:mm", CultureInfo.InvariantCulture).TimeOfDay < DateTime.ParseExact(StartTime.SelectedValue.ToString(), "HH:mm", CultureInfo.InvariantCulture).TimeOfDay)
{
item.Enabled = false;
}
else
{
item.Enabled = true;
}
}
}