Declined
Last Updated: 24 Apr 2024 08:34 by ADMIN
Adam
Created on: 04 Apr 2024 09:07
Category: UI for Blazor
Type: Feature Request
2
Grid with horizontal scrolling should allow percentage size (as opposed to fixed size)

Horizontal scrolling in the grid works when its width is set to a fixed value (px, rem, etc.). But the h scroll disappear when a percentage is assigned to the width of the grid.

This seems to be a known 'feature' to Telerik:

https://docs.telerik.com/blazor-ui/components/grid/columns/width?_gl=1*78gyue*_ga*MzUzNTU3NTM0LjE2ODU2MTc3Njk.*_ga_9JSNBCSF54*MTcxMjIyMTAxNS44My4xLjE3MTIyMjExMzQuOS4wLjA.*_gcl_au*MTA3OTA1NzUyOS4xNzEwNTE1Njgy&_ga=2.263164300.1038437897.1712221016-353557534.1685617769

A sensible behaviour is to have the horizontal scrolling enabled and at the same time being able to set the grid to percentage width.

3 comments
ADMIN
Svetoslav Dimitrov
Posted on: 24 Apr 2024 08:34

Hello Adam,

The Telerik UI for Blazor Grid is rendered as plain HTML with CSS classes that cascade styling via CSS rules. Our components are subject to the same HTML and CSS limitations as a standard HTML table wrapped in a div element.

The calc() method should be feasible to implement in most cases. Unfortunately, at the time of writing this, there is no good way to implement the scenario you are after as a built-in solution. 

That being said, I am marking this request as "Declined".

Regards,
Svetoslav Dimitrov
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources!
Adam
Posted on: 17 Apr 2024 09:22

Hi Svetoslav, I am not thinking of how HTML with CSS would have done it and if this is possible in HTML with CSS in the first place. I am looking logically from a component level where the component would take the max container size (width=100%) and still have scroll inside to fit its columns to the available space.
It might be difficult to implement, but this is a legitimate and normally expected behaviour.
We have been in contact with Telerik Support and the advise was this:

"Indeed, as the linked KB article explains, the Grid expansion results from a combination of CSS styles and cannot be avoided out-of-the-box. I confirm that the only workarounds are:

- Use a fixed non-percentage Grid width. This doesn't necessarily mean to use pixels. You can use vw units or calc() to make the Grid width flexible and depending on the overall page width.
- Rework the parent layout of the Grid, so that it doesn't rely on flexbox or Bootstrap.
Of course, the first option should be simpler."

We have implemented a JavaScript hack to handle this scenario. We spent around 3 days on this issue including the implementation of the hack. The hack is not a clean one as the grid will flicker when we do this and the hack included code on JavaScript level and interop with code in Blazor.

ADMIN
Svetoslav Dimitrov
Posted on: 17 Apr 2024 07:05

Hello Adam,

Can you share with us an example with a <table> wrapped in a <div> of how you expect this behavior to work? 

Regards,
Svetoslav Dimitrov
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources!