JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › ScrollBar › Blazor usage › Reply To: Blazor usage
Hi,
Let’s try that again…
There’s not much documentation on using the ScrollBar in Blazor.
I need vertical and horizontal scroll bars around a div that scrolls the contents of the div. How do I achieve this (code below)?</div>
<ScrollBar Orientation=”Horizontal” Id=”horizontal” Style=”width:100%; position:inherit; bottom:0px;” OnChange=@Horizontal_Change></ScrollBar>
<ScrollBar Orientation=”Vertical” Id=”vertical” Style=”height:100%; position:inherit; right:0px;” OnChange=@Vertical_Change></ScrollBar>
<div id=”scrollableContainer”>
<BECanvas Width=@CanvasWidth Height=@CanvasHeight @ref=”CanvasRef”></BECanvas>
</div>
The scroll bars are there, but moving the scroll bar has no effect.
How do I pick up the scroll offset in the event handlers and apply it to the div? The following throws an exception:
void Horizontal_Change(Event eventObj)
{
string offset = eventObj[“Detail”].Value.ToString();
}
Finally, could you add a method to Hide a toolbar instead of just Disabled?
Thanks