Declined
Last Updated: 16 Nov 2021 15:42 by ADMIN
Pier-Luc
Created on: 08 Jan 2015 14:45
Category: Grid
Type: Feature Request
0
Grid column size "weight"
Add support for flexible width to columns on a "weight" basis (like XAML grid).

Ps. I'm writting the example in MVC wrappers because I'm not familiar with the javascript initialization but I am posting this in Kendo UI Web category because it's a core feature and assume it would be implemented accordingly in every wrappers without having to specify them.

@(Html.Kendo()
  .Grid<Employee>()
  .Name("EmployeesGrid")
  .Columns(cols =>
  {
    cols.Bound(o => o.FirstName).Width("*");
    cols.Bound(o => o.LastName).Width("2*");
    cols.Bound(o => o.Initials).Width("Auto");
    cols.Bound(o => o.JobTitle).Width("200"); // Or 200px
  }))

-Assuming the grid is 900 pixel wide and the longest Initials (including header?) is 100 pixel
-Ignoring the lost horizontal space in padding, margin, borders, scrollbars and anything else

This example would give the following result:
FirstName column: 200px
LastName column: 400px
Initials column: 100px
JobTitle column: 200px
1 comment
Pier-Luc
Posted on: 08 Jan 2015 14:55
Apparently I can't edit my suggestion. I just wanted to add some explanation:

There are 3 width "type". The star (*), Auto and a fixed amount of pixel.

Fixed width: A fixed width in pixels
Auto: The minimum size required to display it's content
Star: The remaining space after Auto and Fixed width divided between the amount of stars. If you give a column 3 star (3*), another column 5 star (5*) and the remaining space after Auto and Fixed width columns is 400, it will divide that 400 in 8 stars (50) and give that amount 3 times to the 3* and 5 times to the 5*.