Time range in a TimeEditFor with DevExpress

0

I am doing a TimeEdit with devexpress and I need only certain ranges to be chosen, my code is as follows:

itemEndDate.SetNestedContent(() => Html.DevExpress().TimeEditFor(model => model.EndTime, settings =>
                                         {
                                             settings.Name = "EndDate" + item.AvailabilityId;
                                             settings.Properties.ValidationSettings.RequiredField.IsRequired = true;
                                             settings.Properties.EditFormat = EditFormat.Time;
                                             settings.ShowModelErrors = true;
                                             settings.Properties.ClientInstanceName = "EndDate" + item.AvailabilityId;
                                         }).GetHtml());

I try to adjust a minimum and a maximum of the hours chosen by the user, someone has a recommendation? thanks.

    
asked by Drz 23.02.2017 в 20:47
source

1 answer

0

The TimeEdit does not provide this type of validations unfortunately. The time value is cycled within 24 hours. I suggest you handle the event TimeEdit.Validating to check the values in function or use ClientSideEvents to validate in JS.

    
answered by 05.07.2017 в 01:05