This is a migrated thread and some comments may be shown as answers.

Grid Width based on number of columns

2 Answers 72 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nilesh
Top achievements
Rank 1
Nilesh asked on 19 Aug 2015, 01:27 PM

Hi There,

 

I have a dynamically created kendo grid. The problem here is that the kendo grid fills up the entire page even when there are just 2 columns in the grid. This is not the desired behavior I need. What I need is tha the grid should fit the columns based on the contents and the grid should fit to number of columns.

 

I tried changing the CSS 

.k-grid table{    display: inline-block}

but this CSS messes up the alignment between the kendo grid header and content columns.

 

Can you guys please guide me on how to achieve this? I have created a JSFiddle with two grids and I want the kendo grid to behave similarly.

2 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 20 Aug 2015, 11:10 AM
Hi Nilesh,

Please check the Grid documentation.

http://docs.telerik.com/kendo-ui/web/grid/how-to/Layout/auto-layout-grid

Regards,
Dimo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Nilesh
Top achievements
Rank 1
answered on 20 Aug 2015, 12:55 PM

Hey Dimo, Thank you very much for this solution. Although I needed scrolling in the grid, which I did by adding my own styles.

 

But your solutions works.

 

Thanks,

Tags
Grid
Asked by
Nilesh
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Nilesh
Top achievements
Rank 1
Share this question
or