Hello everyone,
I am trying to build up a ListView with a model class which has an internal IList<InnerModelType>. So the main model used for the ListView is basically a class with some normal properties and then a property of IList<InnerModelType>. I also specified an item template to resolve this nested List (a separate Blazor.
The Chrome Browser console displays the exeception listed below:
blazor.server.js:15 [2019-09-02T10:48:44.144Z] Error: System.InvalidCastException: Invalid cast from 'System.String' to 'System.Collections.Generic.IList`1[[esa.WebFrontpanel.Base.ViewModel.Components.PlcVariableVM, esa.WebFrontpanel.Base, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]'.
at System.Convert.DefaultToType(IConvertible value, Type targetType, IFormatProvider provider)
at System.String.System.IConvertible.ToType(Type type, IFormatProvider provider)
at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
at System.Convert.ChangeType(Object value, Type conversionType)
at Syncfusion.EJ2.Blazor.BaseComponent.ChangeType(Object value, Type conversionType)
at Syncfusion.EJ2.Blazor.BaseComponent.GetObject(Dictionary`2 Data, Type ModelType)
at Syncfusion.EJ2.Blazor.Lists.ListViewTemplates.BuildRenderTree(RenderTreeBuilder builder)
at Microsoft.AspNetCore.Components.ComponentBase.<.ctor>b__5_0(RenderTreeBuilder builder)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment)
at Microsoft.AspNetCore.Components.Rendering.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry)
at Microsoft.AspNetCore.Components.Rendering.Renderer.ProcessRenderQueue()
Here the component code:
Top ListView with some custom styling:
The _plcDeviceList is of type PlcDeviceListVM, which has a List of PlcDeviceVMs. This type now has again an List<Variable> property. I believe the ListView can not resolve the entries of this List?
Could you please help with this? Am I doing something wrong here? If so, could you please provide a sample to me how to achieve this behaviour.
Best Regards,
Karl