Guid as Id crashes the dropdown list

Hi,

When I try and bind a string which has a GUID format to a dropdown list 

 <SfDropDownList TValue="string[]" DataSource="@Tree.Parent.Options.response_set_object.responses" TItem="Respons" @bind-Value="Tree.Options.values">
            <DropDownListFieldSettings Text="label" Value="id"></DropDownListFieldSettings>
        </SfDropDownList>

We get the following console exception 

Unexpected character encountered while parsing value: a. Path '', line 0, position 0.
   at Newtonsoft.Json.JsonTextReader.ParseValue()

1 Reply 1 reply marked as answer

JC Joseph Christ Nithin Issack Syncfusion Team March 8, 2021 08:31 AM UTC

Hello Alex, 

  Greetings from Syncfusion support. 

  We have checked your query. The use of ‘string[]’ as the TValue in a ‘SfDropDownList’ is inappropriate as we can select only one value in a dropdownlist. So kindly use TValue as ‘string’ for DropDownList and check the issue. Alternatively we suggest you to use ‘SfMultiSelect’, if you are using TValue as ‘string[]’ and selecting multiple values. 


Thanks, 
Joseph Christ Nithin I 


Marked as answer
Loader.
Up arrow icon