Articles in this section
Category / Section

How to add a TabIndex control to a Drop-Down List in ASP.NET Core?

1 min read

In the ASP.NET Core DropDownList control, the input element is hidden and non-editable. When TabIndex is set to the DropDownList control using the HtmlAttributes property, it is set to the input element and TabIndex will not work for hidden elements. So, to set proper TabIndex for the DropDownList control, it must be set to the control’s wrapper element.

 

Consider the following example,

<ej-drop-down-list id="bikeList" datasource="ViewBag.datasource" watermark-text="Select a bike"create="onCreate"> 
    <e-drop-down-list-fields id="empid" text="text" value="text" /> 
</ej-drop-down-list> 
 
<script> 
    function onCreate() { 
        //this.wrapper is the widget’s wrapper to assign the tabindex  value        this.wrapper.attr("tabindex", "1"); 
    } 
</script>
 

 

In the previous code, the DropDownList’s client-side create event is used to set the TabIndex to the control’s wrapper element.

Sample


Conclusion

I hope you enjoyed learning about how to add a TabIndex control to a Drop-Down List in ASP.NET Core.

You can refer to our ASP.NET Core DropDown List feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our ASP.NET Core DropDown List example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied