ListBox Selections Not Visible

I am using the following code to produce a ListBox from a concatenated string:

@page "/"

<RadzenListBox TValue="object" Multiple="true" Data="data.Split('|').Select(_data => new { Text = _data.Split('~')[0], Value = _data.Split('~')[1] })" TextProperty="Text" ValueProperty="Value" Change="(args => OnChange(args))" />

<RadzenListBox TValue="object" Multiple="false" Data="data.Split('|').Select(_data => new { Text = _data.Split('~')[0], Value = _data.Split('~')[1] })" TextProperty="Text" ValueProperty="Value" Change="(args => OnChange(args))" />

@code {
    string data = string.Join
                    (
                        '|',
                        string.Join('~', "Choice 1", "Choice1"),
                        string.Join('~', "Choice 2", "Choice2"),
                        string.Join('~', "Choice 3", "Choice3")
                    );

    void OnChange(object args)
    {
        string selection;

        if (args is IEnumerable<string>)
        {
            selection = string.Join('|', (IEnumerable<string>)args);
        }
        else
        {
            selection = args.ToString();
        }
    }
}

As the mouse hovers over each value in the ListBox the background color changes to indicate the selection. The OnChange method gets processed successfully. However the ListBox does not show the selected items; the backgrounds do not change color nor do the checkboxes get checked.

The expression used in Data property of the ListBox will be evaluated every time state has changed and will produce different items on each cycle. You need to change that:

Using expressions for the Data property does work sucessfully for the DropDownList, RadioButtonList, and CheckBoxList.
I noticed that the args return type is different between CheckBoxList and ListBox when multiple values are selectable. I also noticed that if the TValue was set to string it would fail for ListBox and had to be set to object while string is valid for CheckListBox.

The components are different. ListBox is usually data bound while CheckBoxList was only declarative until recently.