"Add form" with Lookup dropdown from database

Hi Team,

I have an "Add items page" ,e.g. say it contains two fields : Item_id , and item_name.
In the page load I retrieve the list with Items with a custom server method and bind this to a page property .
Field Item_id is a lookup and has this list as data , textproperty is name and valueproperty is id .
So far all good out of the box.

This part I cant get a grip on:
When an Item is selected in the lookup (dropdown) , I want the textproperty of the selected item to be patched to the item_name field on the form , ( it seems redundant but , it is an example).

List is build like '[{"id":1,"name":"item 1"}, {"id":2 ,"name":"item 2"}]

Using the change event of the form I can get the event.property and event.value .
In this case the event seems to be the "Id" value property .

question is how to get the selected dropdown item and the "name" part , the event gives only the value .
hope you can point me in the right direction for this on how to do this in Radzen.

The ValueProperty of the DropDown determines what property of the data item is used as the "value". You can set it to "name" and you will get the value of "name" in the change event.

Hi ,
If I change the value property to "name" than I have no way to retrieve the "id".
Please read the description, maybe not clear but, I have a dropdown and a text field on my add form :
in the database I have a field with : "item_id, item_name" , if I had only the item_id , than the dropdown would store the id in the database and show the name for the user interface , I also want to store the name of the item .

The DropDown component has only one Value property. If you want to get the "whole" data item you can 'unset' the ValueProperty option. Then the Value will be the whole data item.

I ended up using a "dummy" field on the form as the dropdown and updated the values for the fields "item_id" and "item_name" as hidden fields in the change event with patch form.
like:
this.form0.form.patchValue({ item_id: ${event.value}.id } );
this.form0.form.patchValue({ item_name: ${event.value}.name } );

thank you for your support.