New problems with filtering datagrid

Hi Radzen Team, I'm having problems filtering a datagrid, and it seems to be something new, because I've never had these issue's before. If put the expression directly int VS 2019, I don't have problems. Note here with a super simple expression -


But, if I add the same expression to the data property of the grid in Radzen -
Radzen does this - and then if I go back to VS, VS says this - (Removing the "(" & ")" that Radzen adds doesn't help. I've also noticed that any kind of lamda expression causes this big change - first adding to VS '''<RadzenGrid @ref="grid0" AllowFiltering="true" AllowPaging="true" AllowSorting="true" Data="@getResidentsResult.Where(r => r.ResidentsID == 45)" FilterMode="FilterMode.Simple" TItem="Risc.Models.RiscData.Resident" style="height: 600px">







@(data.Prop?.PropertyName)'''

And this after setting the filter expression in Radzen - '''<RadzenGrid @ref="grid0" AllowFiltering="true" AllowPaging="true" AllowSorting="true" Data="@(getResidentsResult.Where(r => r.ResidentsID == 45))" FilterMode="FilterMode.Simple" TItem="Risc.Pages.CopyOfResidentNotesComponent" style="height: 600px">







@(data.Prop?.PropertyName)'''

As you can see, the TItems completely change when adding the expression via Radzen. Until recently, I've had no issues with complex filter expressions like - '''${getResidentNotesResult?.Where(r => (residentFK > 0 ? r.ResidentFK == residentFK : true) && (propertyFK > 0 ? r.Resident.PropertyFK == propertyFK : true) && (propertyportfolioFK > 0 ? r.Resident.Prop.PropertyPortfolioFK == propertyportfolioFK : true) && (r.Resident.AtRisk == atrisk))}'''

I've completely recreated this page from scratch, and have the latest Radzen version and nugets - I think I've tried everything. Is my whole project corrupted? I'm stumped.

Thanks,
Slosuenos

@SloSuenos,

I don't see any difference between those two screenshots. Also I strongly recommend to not use expressions for the Data property. It gets evaluated on every render and causes the DataGrid to reset its state. Instead set the getResidentsResult property to the desired expression value e.g. ${result.Where(r => r.ResidentsID == 45)}

Also please format your code. It is unreadable as of now. You can use Markdown in this forum. Wrap the code with ``` (three back ticks).

We can't determine that from the provided screenshots. If you need further assistance you can send your application to info@radzen.com.

1 Like

@korchev Thank you for your help.