Angular Grid horizontal scrolling

1 Answer 4381 Views
General Discussions
Paul
Top achievements
Rank 1
Paul asked on 07 Dec 2017, 07:26 PM

I am having trouble trying to get the grid to produce a horizontal scroll bar in angular 5 app. At the moment it tries to scrunch the data into the available space within the container. I have tried setting column widths to make it grow and it stopped scrunching the data but still no horizontal scroll bar. Does anyone have a fix for this?

Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 08 Dec 2017, 08:42 AM

Hello Paul,

You must set width of the Grid component itself which is less than the sum of all columns width. Example - http://plnkr.co/edit/xwsRZKnwS6tL3pq6j2UN?p=preview

Regards,
Nikolay Rusev
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Paul
Top achievements
Rank 1
commented on 14 Dec 2017, 09:11 PM

Thanks...that worked.
Chau
Top achievements
Rank 1
commented on 13 Nov 2019, 05:54 PM

I have a grid with one <kendo-grid-column-group> with locked=true, and 3 remaining <kendo-grid-column-group> with locked=false.

Currently, the grid shows a horizontal scrollbar at the bottom of the grid. I have a requirement to also show the horizontal scrollbar at the top of the grid under the headers.  How do I achieve that?

Thanks!

Martin
Telerik team
commented on 15 Nov 2019, 11:23 AM

Hi Chau,

I opened a private support thread from your behalf in order to maintain a clean history of the Forum. Please find the answer to the same question in the ticket 1442378.

I'd suggest continuing communication there. This will facilitate a better support history of your account and help us to provide a better support service in general.

Thank you in advance.

Regards,
Martin
Progress Telerik

Get quickly onboarded and successful with your Telerik and Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Vermula
Top achievements
Rank 1
commented on 04 May 2020, 05:51 PM

Hi Martin,

I am not finding below ticket. could you please help me out. 

https://www.telerik.com/account/support-tickets/view-ticket?threadid=1442378

 

Martin
Telerik team
commented on 05 May 2020, 02:02 PM

Hi Vermula,

I am pasting the answer here:

"In general, this functionality is not supported as a built-in feature by Kendo UI for Angular Grid. However, it could be achieved using some custom JavaScript implementation.

In this case, a new scrollbar element needs to be created and position on the desired location (below the headers). The scrollbars should be synced with the scrollLeft properties of both scrollbars.

I further used the following example as a guideline:
http://jsfiddle.net/dagope/DtRTq/

and created a top scrollbar for the Grid:"
https://stackblitz.com/edit/angular-gquvrl-zrxznv?file=app/app.component.ts

 

And for Grid with locked columns:

"By design, the locked columns feature creates separate tables in the DOM - one to hold the locked section (e.g. .k-grid-content-locked), and one - for the scrollable part (e.g. .k-grid-content). Please refer to the screenshot.

The custom scrollbar is wrapped in a div that can be inserted between the elements. In the example provided in the previous ticket, the scrollbar is added above the .k-grid-container...:

... but it also can be appended to the scrollable part of the Grid as the following example shows."

https://stackblitz.com/edit/angular-gquvrl-7v7cyz?file=app/app.component.ts

Adding some additional CSS styles and calculations makes the top scrollbar behave as the default one. However, the requested functionality isn't a built-in feature of Kendo UI for Angular and thus it isn't supported. Basically, we try to provide guidelines or workarounds that help to achieve custom use-case scenarios. The example might need some further modification in order to meet the project requirements, but such effort falls out of the scope of the support service.

I hope the above suggestion and example shed some light on this case. Please let me know in case any further assistance is required for the supported Kendo UI for Angular features.

Regards,
Martin
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.


Tags
General Discussions
Asked by
Paul
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Share this question
or