HI,
I developed the following code to dynamically display accordions within lists.
<RadzenAccordion Visible="!switchListType" Multiple=true>
<Items>
@{
//Tiene traccia del primo elemento
bool isFirstTimeForTank = true;
}
@foreach (var group in lstInventoryTankSearch)
{
<RadzenAccordionItem Text="@group.TankGroup.Replace("_", " ")" Style="background: var(--rz-secondary-light);" Selected=isFirstTimeForTank>
<RadzenListBox TValue="ResultTankForEachGroup" Data=@group.Tanks
Change="@OnListBoxItemSelected2"
Style="width: 100%; max-width: 400px; border: none; height: 100%">
<Template>
<span class="hover-hand @GetCssClassNameFromTankStatus(context.TankStatus)">
@(context.TankName)
</span>
</Template>
</RadzenListBox>
</RadzenAccordionItem>
// Imposta a false dopo il primo elemento (nel caso in cui sto effettuando una ricerca, espando tutti gli accordion)
isFirstTimeForTank = string.IsNullOrEmpty(strSearchTankOrProduct) ? false : true;
}
</Items>
</RadzenAccordion>
For DUBUG I'm using this:
@foreach (var group in lstInventoryTankSearch)
{
<div>
@group.TankGroup.Replace("_", " ")
<ul>
@foreach (var tank in group.Tanks)
{
<li>@tank.TankName</li>
}
</ul>
</div>
}
Practically through a RadzenText used as a search filter, I filter the lstInventoryTankSearch list so that the agreements are updated.
The list displayed in the debug foreach is correct, however the accordions are not updated correctly.