Hello,
I have a question regarding the persistence of content when blazor splitter panes are collapsed and expanded.
Please refer to the attached project to see the issue that I'm having.
Regards,
Gerard
Hi,
It is possible with set Size to 0px and Resizable to false.
<TelerikSplitter >
<SplitterPanes >
<SplitterPane @bind-Size="@MenuSize" Resizable="@ShowMenu" Collapsible="false">
<MainMenuUC @ref=@RefMenu></MainMenuUC>
</SplitterPane>
<SplitterPane>
@Body
</SplitterPane>
</SplitterPanes>
</TelerikSplitter>private bool ShowMenu { get; set; } = true;
public string MenuSize { get; set; } = "200px";
private string MenuSizeOld { get; set; } = "200px";private void ClickMenuHandler(object? sender, EventArgs e)
{
ShowMenu = !ShowMenu;
if (ShowMenu)
{
MenuSize = MenuSizeOld;
}
else
{
MenuSizeOld = MenuSize;
MenuSize = "0px";
}
StateHasChanged();
}
Hi Gerard,
Thanks for the runnable project. I am converting this ticket to a public feature request and we will evaluate it. (By the way, it's better to include explanations in the ticket, rather than the project.) I am pasting the important part here:
>> I'd like to have the content of a splitter pane persist between the collapse and expand events, but I don't see a property for this (similar to the PersistTabContent="true" property for the TabStrip component).
In the meantime, my suggestion is to retrieve the TreeView Data and bind the component automatically in OnInitialized or another suitable event of TreeComponent.razor, so that there is no need to do it manually every time. If your main goal is performance and efficiency, you can even experiment with an implementation that stores or passes the TreeView Data from the parent component.
Regards,
Dimo
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.