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

On focus, select DropDownList existing entry for virtualized dropdown in grid

4 Answers 96 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 04 May 2017, 12:41 PM

Hello.  I'm using Kendo UI ASP.NET.  I have a grid with 2 dropdowns.  The first dropdown is not virtualized, the second one is (and also cascades off the first dropdown).  All of this works.

I need to be able to quickly tab through all columns and rows in the grid using only the keyboard.  If the 2nd dropdown gets focus and the current value isn't yet loaded in the virtualized dropdown, I get stopped with a client-side "This value is required" error message.  I would like to know what the best strategy is to force the 2nd dropdown to navigate to the dropdown entry (in psuedocode, .select() to the virtualized, non-loaded entry) associated with its current value even when that entry is not yet loaded because of virtualization when that 2nd dropdown receives focus.

Thanks,

Richard

4 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 08 May 2017, 09:45 AM
Hi,

Unfortunately there is not dynamic way to select a non-loaded item from a virtualized DropDownlList.

Regards,
Plamen
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Richard
Top achievements
Rank 1
answered on 08 May 2017, 01:06 PM

Is there a way to bind .DataValueField when the grid is loaded without navigating to the virtualized entry in the DropDownList?  If I have AutoBind set to true, tabbing through the DropDownList works just fine for things "early" in the list that are already loaded.  AutoBind does not, however, appear to work for entries that aren't loaded.

I just need the DropDownList to have a value in the data value field so I don't get the "no value" error.

Side note:  Turning off validation doesn't help.  In this case, if I tab through the field, the DropDownList ends up with no value bound to it; I need the current .DataValueField to be bound to it in this use case.

0
Accepted
Plamen
Telerik team
answered on 09 May 2017, 09:00 AM
Hi,

One possible solution I could think of is to set the initial Value property to some desired default value so that you can pass the no value error.

Regards,
Plamen
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Richard
Top achievements
Rank 1
answered on 09 May 2017, 12:56 PM

That did it.  A very basic answer, I just had trouble asking the right question.  Simply set the default value by calling Value() on the DropDownList:

    Html.Kendo().DropDownListFor(model => model)
        .Value(Model.Description)

Thanks!

Tags
DropDownList
Asked by
Richard
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Richard
Top achievements
Rank 1
Share this question
or