TreeView selected node focus

Hello!

I'm setting the selected treeview node from code behind and would like for it to scroll in to view.
Is there support for this or does anyone have an idea on how to solve this?

Thanks in advance!

You can try using JS interop:

protected override void OnAfterRender(bool firstRender)
{
  JSRuntime.InvokeVoidAsync("eval", "document.querySelector('.rz-treenode-content-selected').scrollIntoView()");
}
1 Like

Thank you very much. I should have thought about that but sometimes stress is not your friend. :slight_smile: