Chained/Multiple TextProperties in DropDown/DropDownDatagrid

Is it possible to concatenate multiple TextProperties to be shown in a DropDown/DropDownDataGrid in an expression?

For example something like "Customer_ID + Customer_Name"?

Thanks in advance,

Martin

Yep, there is a DropDown Template property:

Not possible in the DropDownDataGrid however.

Thank you, Iยดll give it a try.

I'm trying to do this, and can't get it to work. Can someone explain how to concat two columns together to display in a dropdown component?

If I use the Template, I get: [object Object]

Thanks!

A similar scenario is demonstrated here: https://www.radzen.com/documentation/crm-customize-crud/#display-the-first-and-last-name-in-the-opportunities-datagrid

You either set the Template as a string ${data.FirstProperty} ${data.SecondProperty} or use design time and drag-and-drop two label components and set their Text property.

1 Like

I'm not able to get it to work.

I'm leaving the TextProperty blank, no selection and setting the Template to ${data.GivenName}:


And this is what I get:
image

If I select GivenName from the TextProperty dropdown, it works. But just for that column.

Yes, TextProperty should be set. The Template property only works for the dropdown items.

OK I see that now.
I have it working better now, but I'd like to show the GivenName and FamilyName in the control.
How do I to that?

Hey @danh,

You can add additional, not mapped property to your model and use it as TextProperty.

Is that something I can do in Radzen, or do I have to make some code modification somewhere? Any documentation or example?

(Sorry, I'm new to Radzen)
Thanks, Dan

OK I finally got it with the help of a co-worker. Seems like a lot of work just to concat two values to show in a control...

Hi @korchev!
Thanks for this advice, just what I needed. Now I'm wondering, is it possible when using the template as a string${data.FirstProperty} ${data.SecondProperty} to make one of the properties bold and have a line break between them? (So it looks like a header):
Property 1
Property 2

Thanks again!

The following should work:

<strong>${data.First}</strong><div>${data.Second}</div>

1 Like

Thank you @korchev, that worked perfectly :slight_smile: