Hi. I put a Radzen tree in my sidebar component. When I click on a Document navigates to another component that displays info about the Document in different blocks. Each block is inside a Radzen accordion. What I want is, if the block has info, set its accordion selected true. If the block is empty, sit its accordion selected false.
When click on Doc1 it works as expected but when click on any other Doc all accordions "remember" its previous selected state and my dynamic setting just doesn't work. When debbuging it sets expected values.
Even if I hardcode Selected=true, if last document was collapsed, next document will be collapsed.
Thanks.
@page "/documentdetails/{id:int}"
...
<RadzenAccordion Multiple="true">
<Items>
<RadzenAccordionItem Text=@localizer["dockeywordaccordionheader"] Icon="files" Selected=@bKeyword Style=@sStyleKeyword>
<table class="table">
<tbody>
@foreach (var docKeyword in documentKeywords)
{
<tr>
<td><b>@docKeyword.Keyword</b></td>
</tr>
}
</tbody>
</table>
</RadzenAccordionItem>
</Items>
</RadzenAccordion>
@code {
protected override async Task OnParametersSetAsync()
{
try
{
documentKeywords = await DocumentKeywordService.GetDocumentKeywords(id);
if (documentKeywords.Count() > 0)
{
sStyleKeyword = sStyleAccordeonFull; }
bKeyword = true;
else
{
sStyleKeyword = sStyleAccordeonEmpty; }
bKeyword = false;
}
catch (Exception ex)
{
error = ex.Message;
}
}
}