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

Cannot get MVC grid to auto-size to content

1 Answer 45 Views
Grid
This is a migrated thread and some comments may be shown as answers.
IT Dept
Top achievements
Rank 1
IT Dept asked on 14 Sep 2018, 12:48 PM

I'm having an issue with the ASP.Net MVC wrappers for Kendo. 

 

I'm using "@progress/kendo-ui": "2018.2.806" via npm, and the Visual Studio MVC Plugin version 2018.1.221.

I'm also using the SASS theme via "@progress/kendo-theme-default": "2.54.1".

This is a change from using older versions of the library and the LESS themes. An issue I'm running into is paged grids that used to auto-size to full height are not. (These grids are also scrollable to facilitate horizontal scrolling). 

I've tried combinations of HtmlAttributes(new {style = "height: auto"}) and Scrollable(s => s.Height("auto")) but the k-grid-content section keeps having an element specific style set on it specifying the height at a fixed value. This is a problem if the grid loads in a filtered view with fewer rows (the height gets set to the max height of three rows) then a filter is removed and more data loads (the grid remains at a height of three rows).

Is there anything I'm missing to try? I don't want to have to write custom js for each grid to remove that style and set it to `auto`.

1 Answer, 1 is accepted

Sort by
0
IT Dept
Top achievements
Rank 1
answered on 14 Sep 2018, 02:53 PM
By only setting the scrollable property and not the html Attribute I got it working.
Tags
Grid
Asked by
IT Dept
Top achievements
Rank 1
Answers by
IT Dept
Top achievements
Rank 1
Share this question
or