Disabling DropDownList

Hi,

I'm trying to disable dropdown list but it's not working well. The control switch to gray but the user can switch selection or enter new text.

How can I set the control to gray AND lock the modification?

Thank you


1 Reply

IB Ilakkiya Baskar Syncfusion Team April 19, 2018 07:21 AM UTC

Hi Tommy    
Thank you for contacting Syncfusion Support. 
We analyzed your query. We suggest you to use enabled property to false to disable the DropDownList component. Please refer the code block below, 
[View] 
 
@Html.EJS().DropDownList("games").Enabled(false).Placeholder("Select a game").PopupHeight("200px").DataSource((IEnumerable<object>)ViewBag.localdata).Render() 
 
 
[controller] 
 
public IActionResult ddl()        {            ViewBag.data = new string[] { "American Football", "Badminton", "Basketball", "Cricket", "Football", "Golf", "Hockey", "Rugby", "Snooker", "Tennis" };            return View();        }
 
 
Please refer the UG documentation in the below link, 
 
Let us know if there is any concern, we will be happy to assist you. 
  
Regards, 
Ilakkiya B 


Loader.
Up arrow icon