June 5, 2020, 2:17pm
I hope you can help.
I want to bind a List object to the Data Grid, the List is manually created and not bound to a DB result, but I get the following error:
I have a master detail page that I have manually created. The detail section requires the users to select from a drop down (the type) then enter a description. Pressing Add, adds the data to an item in the List. I then want the List displayed in the gird.
Here is the definition of the class for the List item…
Here’s the Add event….
and the grid columns, where you can see the properties appear ok…
Finally, here is the error in VS..
What have I done wrong, a List implements IEnumerable, so I don’t get the VS error and the Radzen error Invalid expression term ‘>’ doesn’t help either.
Nothing is written to the DB until the whole page is completed.
Try adding a custom attributer with name
TItem and value
Recroledetailview. We will investigate why Radzen can't handle this case properly.
June 8, 2020, 1:07pm
That didn't make any difference.
June 9, 2020, 1:47pm
Have you had a chance to investigate this issue yet?
According to this screenshot:
you are trying to assign
IEnumerable<IList<T>> to DataGrid Data property while you need only
IEnumerable<T>. The grid cannot be bound to collection of collections. What is your TItem attribute at the moment?
June 9, 2020, 2:25pm
I'm not binding it to a collection of collections, Radzen is adding that code. Look at the Set Property snippet, I'm binding it to a list, which is the TItem:
details = new List<Recroledetaillview>();
No complaints in the code.
The columns don't have an issue with the list and I can add the properties.
I can't see what I've done wrong.
We investigated the issue and confirm it is a bug in Radzen. The following is a viable workaround:
Set property action that initializes the details property and change Property type from
Select the DataGrid and clear its Data property.
Set it again to
We will try to fix the problem with incorrectly inferring the argument of List properties.
June 9, 2020, 2:39pm
Thank you, I will give it a go and let you know if it works ok.
June 9, 2020, 2:55pm
Unfortunately that didn't work either.
The error in the grid went from:
I'll have to wait until you have a fix.
Thank you for your help.
The fix we will release will require you to recreate the property and datagrid in a similar manner.
Another easy fix is to edit the json file of your page and change "itemType" to Recroledetailview.
June 9, 2020, 3:12pm
It looks like changing the JSON file works as a workaround.