Disable the dropdown option when the database table has that option

Hello!
I have the table tbl_booking with field book_id,reg_id,preferred_date,timeslot,serviceprovider_id,and,services. I used select dropdown for the timeslot, to select the timeslot which will check on the tbl_booking and check that the particular serviceprovider_id and particular timeslot should select only 2 times on the particular date. Then the timeslot option should be disabled if the condition is true.



1 Reply

PO Prince Oliver Syncfusion Team March 18, 2020 06:53 AM UTC

Hi Ishan, 

Thank you for contacting us. 

We have provided MaximumSelectionLength property in the control to the limit the selection in our MultiSelect control. Kindly set the property value as 2 to achieve your requirement. 

@Html.EJS().MultiSelect("default").Placeholder("Select games").DataSource((IEnumerable<object>)ViewBag.data).Mode(Syncfusion.EJ2.DropDowns.VisualMode.CheckBox).MaximumSelectionLength(2).Fields(new Syncfusion.EJ2.DropDowns.MultiSelectFieldSettings { Text = "Game", Value = "Id" }).Render() 

Documentation reference: 


Let us know if you need any further assistance on this. 

Regards, 
Prince  


Loader.
Up arrow icon