Adding custom data attribute to html <option> tag within a @Html.EditorFor in an MVC Razor view
I want to add a custom data attribute to each option in my selectlist, which I could achieve with jQuery.data() or .attr().

However, I am setting up my selectlists with the following html helper:

    @Html.EditorFor(x => x.MySelect, MVC.Shared.Views.EditorTemplates.KeyValuePairSelectList, new { SelectListOptions = Model.MySelectList})

Is there a way to do it in the new{} method of the EditorFor?
Adding custom data attribute to html <option> tag within a @Html.EditorFor in an MVC Razor view
===

I want to add a custom data attribute to each option in my selectlist, which I could achieve with jQuery.data() or .attr().

However, I am setting up my selectlists with the following html helper:

    @Html.EditorFor(x => x.MySelect, MVC.Shared.Views.EditorTemplates.KeyValuePairSelectList, new { SelectListOptions = Model.MySelectList})

Is there a way to do it in the new{} method of the EditorFor?