Listbox setting selected values

I have a listbox which I'm populating from a view. It contains the full set of options available.

I then have a datagrid which on each row of I have a comma delimited field which contains a list of selected options for the listbox. The reason I do this is that when I called a custom function with the multi-selected values it passed through a comma delimited value.

I thought all I would have to do is set the value to the property that contains the list and it would just work. Unfortunately it didn't and I'm struggling to find any related documentation or discussions. Could anyone help please? While I'm using Radzen, I was hoping to learn Angular but I'm struggling to find reasons to resort to anugular myself. So angular knowledge is not great.

I've got the values in javascript, using execute code, but having trouble setting the selected (multiple) options.

Any help most appreciated,

Hi @spookyCol,

You need to set the Value property of the ListBox. If you have specified ValueProperty you need to set Value to an array containing the target values. Here is a sample configuration:

1 Like

I tried that, but it doesn’t show. I did notice that when I select an option it doesn’t work i.e. show the tick box. However, when I select the toggle all everything starts to work. Could this have something to do with.

Here are my steps (if that’s ok):
Page.Load - Set property CatList to ‘’
Grid.RowSelect() - Set CatList to ${event.CatName}

As recommended set Value property:
Doesn’t work, see below (showing id’s just so that you can they match)

Check my configuration which is working and compare to yours.

Sorry to be a pain.
When I hard code it, it works perfectly:

But when I set it through code it doesn't work:

Even though the results from the alert are saying the same thing:

Am I being stupid here?

If CatName is a string then it won't work. It needs to be an array of numbers.

Ah I see, it's coming back from a view. Which will return a string.

Perfect, thanks.

Just changed it to:

Thanks for all your help, I really appreciate it