RadzenFieldset issue with state

Hi.

I have found the issue with RadzenFieldset control.
I am using Collapsed = true property in markup.
Inside fiedset i have several textboxes. Whenever i am changing the state of any textbox, fiedset is get collapsed automatically, so it is not keeping it state (because that it was specified in markup).

Could be fixed by

  1. adding property into the class

private bool _collapsed { get; set; } in RadzenFiedset

Changing code to:

if (this.Collapsed)
          __builder.AddMarkupContent(16 

to

 if (this._collapsed)
	  __builder.AddMarkupContent(16
protected override Task OnParametersSetAsync()
{
      this.contentStyle = this.Collapsed ? "display: none;" : "display: block;";
      return base.OnParametersSetAsync();
}

to

protected override Task OnParametersSetAsync()
{
      this.contentStyle = this._collapsed ? "display: none;" : "display: block;";
      return base.OnParametersSetAsync();
}
private async Task Toggle(EventArgs args)
{
      RadzenFieldset radzenFieldset = this;
      radzenFieldset.Collapsed = !radzenFieldset.Collapsed;
      radzenFieldset.contentStyle = radzenFieldset.Collapsed ? "display: none;" : "display: block;";
      if (radzenFieldset.Collapsed)
        await radzenFieldset.Collapse.InvokeAsync((object) args);
      else
        await radzenFieldset.Expand.InvokeAsync((object) args);
      radzenFieldset.StateHasChanged();
}

to

private async Task Toggle(EventArgs args)
{
	this._collapsed = !this._collapsed;
	this.contentStyle = this._collapsed ? "display: none;" : "display: block;";
	if (this._collapsed)
		await this.Collapse.InvokeAsync((object) args);
	else
		await this.Expand.InvokeAsync((object) args);
	this.StateHasChanged();
}

Will be fixed in the next update.

Thank you.

Forgot to add, that method should be also added, but i guess you know this :slight_smile:

protected override Task OnInitializedAsync()
{
			_collapsed = Collapsed;
			return base.OnInitializedAsync();
}