I have an older question which seems to have gone stale even when I ask further questions there. I was getting immediate responses then nothing.
The situation is I have a Radzen Grid with expandable rows. Within those rows I set the template to display some child results in another Radzen Grid. That grid has filtering sing a drop down list populated by an enum. The filtering works perfectly but collapses the row of the parent grid.
Does anyone know how to prevent this?
For reference here's the post DataGrid behaviour collapse and filtering behaviour
This is the Radzen community forum - we do not guarantee replies from the Radzen staff. We do provide dedicated support as part of the Radzen Professional subscription.
The problem you are describing in your other thread isn't easily reproducible. We would need a complete example that we can run. This would increase the chance of us reproducing the problem without having to extract a working example from the code you have provided.
Hi, thanks for the reply. I have stripped down the project I'm working on leaving a bare minimum example illustrating the issue which can be found here.
There is a top level Grid. Expand that then modify the selection in the drop down list and you'll see the expanded row collapse. This is really tedious when dealing with hundreds+ rows when you have to scroll back to and re-expand the row to see the results of the new filter selection. This issue was also happening when the list was single selection.
If it's just an attribute I need to specify somewhere in my template, it's not particularly obvious so any pointers would be great.
If it is something that you will address in your framework, hopefully it can be catered for in the near future. If not we'll have to find another framework due to time constraints on our deliverables.
The project throws an error at runtime:
In this case you should better find another framework as we can't reproduce the issue and you couldn't provide a replication.
I've never seen that particular error in my development on this project. Maybe disable the windows auth option under the Project Properties as well as the middleware authentication and authorisation lines?
I wasn't saying if it's not fixed today I'll move on. If after your analysis of the code I provided it isn't something you'll address then I'll consider another platform. Can we please firstly work out if it's a defect or intended behaviour with a workaround or otherwise?
I've taken out everything around authentication. The configure services call in Startup has IIS authentication Scheme, perhaps that wa s problem, but I've removed the Authorize Blazor template tags from the various templates it was in.
The problem comes from the parent grid Data property expression. This will set the Data property on every change and the DataGrid will clear expanded and selected items on every Data change. We will see what we can do to support such scenario.
Ah cool thanks. I thought it might have been something like that. A private framework I've used did something similar where it wasn't able to identify a specific element.
I really appreciate the time. Thanks so much
I noticed there was an update to your lib. The row now remains expanded but there's issues with the filters being cleared. I'm not sure if 2.12.2 is a work in progress or intended to be a complete working version of the solution.
The video below shows behaviour before and after the update to 2.12.2. The new behaviour leaves the row expanded when items in the inner grid filter are changed, but every item in the drop down is cleared when anything is deselected or selected. Once clear no item check ever persists. Interestingly when you check one of them the filter does actually work but the drop down check mark doesn't remain selected. You can see the items related to what is ticked appear but as soon as the mouse moves off the drop down the results are cleared. I guess an OnMouseEnter event is clearing the @bind-value attribute values which is triggering the update on the view resulting in nothing to display.
Hi, thanks for that.
Just so I can understand what's going on, given the filtering worked previously with the enum parsing in the template, now the collapsing issue is resolved how does simply pushing that enum parsing code verbatim into the code-behind file fix the selected item clearing problem?
@steveski As we discussed already the page state will be changed because of expressions in properties. Expression like
Select(i => i) will be reevaluated and on each state change you will get new set of items with different hash code. Radzen components are using items hash code internally to keep selection, etc.
So is there a difference with the projection being in the code-behind rather than the template?
Yes. The difference is this: