This is a migrated thread and some comments may be shown as answers.

[Solved] Specify the tabindex on a combobox

1 Answer 153 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mario
Top achievements
Rank 1
Mario asked on 24 Apr 2012, 08:01 PM
Hello Telerik team,

I would like to know who to specify the tabindex value on an mvc combobox control, I already tried a few things but nothing seems to work, the last I tried is:

@(Html.Telerik().ComboBox()
                        .Name("ddPhysicianSalutation")
                        .AutoFill(true)
                        .DataBinding(binding => binding.Ajax().Select("_GetSalutations", "Referrals").Cache(false))
                        .HtmlAttributes(new { tabindex = "20" })
                        .Filterable(filtering =>
                        {
                            filtering.FilterMode(AutoCompleteFilterMode.StartsWith);
                        })
                        .HighlightFirstMatch(true)
                        .OpenOnFocus(true)
                    )


Thanks

1 Answer, 1 is accepted

Sort by
0
Accepted
Petur Subev
Telerik team
answered on 25 Apr 2012, 10:46 AM
Hi Mario,

To assign the tab-index successfully you should use the following declaration:
@(Html.Telerik().ComboBox()
    .AutoFill(true)
    .Name("Teachers")
    .BindTo(newSelectList(ViewBag.Teachers, "Id", "ContacInfo.Name"))
    .HtmlAttributes(new{ Style = "width:175px; line-height: normal;"})
    .InputHtmlAttributes(new{ tabindex = "1"})


All the best,
Petur Subev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
Tags
ComboBox
Asked by
Mario
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or