11 Replies
The type 'System.Collections.Generic.List
1[[System.String, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]' does not have an associated TypeConverter that supports conversion from a string. Apply 'TypeConverterAttribute' to the type to register a converter."`
.I'm not super familiar with TypeConverter, but shouldn't the destination type be List<string> instead of string? I don't think it will use IListStringConverter if it doesn't support List<string>. Your CanConvertTo will return false for List<string>.
changed but still doesnt work
with this it works
Sorry @kroks1337 your message contained blocked content and has been removed!
this seems dumb
also I have another issue now, the IList<string> -> string works perfect but the binded List<string> does not get updated when changing text in the text area
<textarea placeholder="Domains" @bind=DataService.Filter.AcceptedDomains></textarea>
I am not finding documentation on using TypeConverter with Blazor, but there are a few third party articles and the GitHub issue where it was first implemented. According to the GitHub issue, you have to use TypeConverter with a class that is annotated with the TypeConverter and that overrides ToString. Inheriting from List<string> might work, but looks odd. What happens if you override ToString() on ConvertibleStringList and create the single string representation?
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.