Support binding to string array(IEnumerable<string>)

Hello,


I tried the ListView control and tried to bind the DataSource to a string array, then it threw a NullReferenceException:

```

Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]

      Unhandled exception rendering component: Object reference not set to an instance of an object.

System.NullReferenceException: Object reference not set to an instance of an object.

   at Syncfusion.Blazor.Lists.SfListView`1[[System.String, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].GetLiElementData(ListElementReference args, Boolean ischecked)

   at Syncfusion.Blazor.Lists.SfListView`1[[System.String, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].GetProperties()

   at Syncfusion.Blazor.Lists.SfListView`1.<OnAfterScriptRendered>d__3[[System.String, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()

   at Syncfusion.Blazor.SfBaseComponent.OnAfterRenderAsync(Boolean firstRender)

   at Syncfusion.Blazor.Lists.SfListView`1.<OnAfterRenderAsync>d__2[[System.String, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()

   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)

```

I think the issue is related to this post: Filtering with a List of strings and not objects, where the problem is due to the lack of support to List<string> as the data source.

Therefore, I'd like to request support data binding to string array(IEnumerable<string>).


Looking forward to your reply.

Xi



2 Replies

SM Shalini Maragathavel Syncfusion Team September 3, 2021 02:33 PM UTC

Hi Customer, 
 
Sorry for the inconvenience.  
 
We have validated your reported issue with ListView component and considered the reported scenario “ListView throws script error while binding the string array data source” as a bug from our end. The fix for this issue will be included in our weekly patch release which is expected to be rolled out by the end of September 2021.    

You can track the status of your reported problem through the below portal link. 
  

Until then, we appreciate your patience. 

Regards,
Shalini M. 



SM Shalini Maragathavel Syncfusion Team September 16, 2021 06:49 AM UTC

Hi Customer, 

We deeply regret for the inconvenience. 

On further validation on the reported scenario, we would like to let you know that the reported problem is not an issue from our end. We have removed the array binding support to the ListView component after the Volume 3 release.  

To overcome the problem, we have provided a model binding support for ListView component in this latest release (18.3.35). Refer to the release notes below.  
  
  
Using the model support, you can access all the functionalities of ListView component.  
  
Refer the documentation link for ListView component.  
  

However, we have considered the scenario “Provide support for string array data source in ListView” as a feature which will be included in any of our upcoming releases. Generally we will plan and implement the features based upon the feature rank, customer request count and the wish-list plan. 

You can track the status of this feature through the below portal link. 
 
   
Regards,
Shalini M. 



Loader.
Up arrow icon