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

Blazor TelerikDropDownList

1 Answer 189 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
khashayar
Top achievements
Rank 1
Veteran
khashayar asked on 04 Dec 2019, 02:28 PM
Hello,
i wanted to know how can i get the the whole object instead of pass ValueField and Get That as a value 

<TelerikDropDownList Data="@myDdlData" TextField="MyTextField" ValueField="MyValueField" @bind-Value="selectedValue"></TelerikDropDownList>

like in here i want my ValueField be the whole object no MyValueFierd

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 04 Dec 2019, 03:00 PM

Hi,

This is possible if you are binding to primitive types: https://docs.telerik.com/blazor-ui/components/dropdownlist/data-bind#primitive-types.

Alternatively, you should do a lookup in the model collection based on the value. You can read more about this in the following thread where a more detailed discussion is available: https://www.telerik.com/forums/binding-to-an-instance-of-the-same-type-as-the-ienumerable.

 

Regards,
Marin Bratanov
Progress Telerik

 UI for Blazor
Tags
General Discussions
Asked by
khashayar
Top achievements
Rank 1
Veteran
Answers by
Marin Bratanov
Telerik team
Share this question
or