Version 3.1.0 v 3.0.10 Build Errors

Hi

I installed version 3.1.0 and started to get build errors, in particular:

CS0266 Cannot implicitly convert type 'object' to 'WarrantModels.Warrant'. An explicit conversion exists (are you missing a cast?)

If I revert to version 3.0.10 all is Ok

On investigation the builder emits different g.cs code under each version for the same line of code:

ERROR g.cs line radzen 3.1.0 __builder.AddAttribute(260, "ValueChanged", new System.Action<System.Object>(__value => CurrentSelectedRow = __value));

OK g.cs file rsdzen 3.0.10 __builder.AddAttribute(260, "ValueChanged", new System.Action<WarrantModels.Warrant>(__value => CurrentSelectedRow = __value));

It seems to be centered around the datagrid option:

@bind-Value="CurrentSelectedRow"

I am unsure of where to cast in these circumstances

Any pointers would be appreciated, (p.s.I'm not using the Radzen IDE but embedding the components in razor pages.)

Kind Regards

Sean Francis

Hi @Sean,

Yes, we changed Value property type of the DataGrid from TItem to object because of the multiple selection feature similar to our other components like DropDown, DropDownDataGrid, etc. Now Value can be a single object or IEnumerable<object>. You can either change your variable CurrentSelectedRow to dynamic or use the approach from our demo (Value="@order" RowSelect="@(args => order = args)").

Update: I've just pushed update to the demo to use bind-Value instead RowSelect.

Thank you Enchev for your prompt reply and assistance. I will look into resolving our issues with this information.

Kind Regards

Sean Francis

Hi @Sean
Did you fix this issue ?
When i upgrade and change the code according the demo sample I still have CS0266 Cannot implicitly convert type 'object' to ''. An explicit conversion exists (are you missing a cast?)

Hi Mehdi

We were finding this issue when using the @bind-Value option on the Radzen Grid. I resolved the build error by using the Value option instead of @bind-Value,

In the RowSelect event you can cast the RowSelect argument to whatever variable that was originally pointed to by the @bind-value statement, thereby achieving the same result.

Hope this helps

Hi Sean
Thanks for the reply
What you say is actually working
Unfortunately i need the bind value as i'm using a master detail grid

Hi @mehdi
I know this is an old thread, but did you ever fix your problem? I am having the exact same issue, and I am trying to build a master detail grid.
Thanks in advance
Peter