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

Resize and Expand Grid

3 Answers 375 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Iron
Iron
Veteran
Dan asked on 27 Sep 2018, 10:18 AM

According to telerik the resize and expand of grid should works like in the link

https://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/Layout/resize-grid-when-the-window-is-resized

But this can not be used with the asp.net core wrapper.

I am using Scrollable(s => s.Height("auto")) that generates the configuration scrollable: { height: "auto"  }, and what I need is not to be generated or scrollable: true

The unexpected behaviour can be viewed here: https://dojo.telerik.com/OTuTEQOf where every other refresh the grid has the expected size or its auto.

What is the alternative for asp.net core and of course for asp.net framework to have this functionality?

3 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 01 Oct 2018, 01:01 PM
Hello Dan,

In order to make the MVC and Core Grid wrappers take 100% of the available height I would suggest calculating the height of the screen and setting the height for the Grid using JavaScript. 

For your convenience I prepared a small sample illustrating the approach. Give it a try and let me know how it works for you. 


Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Dan
Top achievements
Rank 1
Iron
Iron
Veteran
answered on 01 Oct 2018, 01:51 PM

Hi Viktor,

Unfortunately your solution is not generic. You had set the extra space as 75 but I need a solution that works on any page.

Eventually I had to do this

if (grid.options.scrollable !== true) {
      grid.setOptions({ scrollable: true });
}

 

Not ideal but it gets the job done.

0
Viktor Tachev
Telerik team
answered on 04 Oct 2018, 08:13 AM
Hello Dan,

Thank you for the feedback and for sharing the approach you went for. 

The sample from my previous post shows the basic approach that can be used for resizing the Grid. In order to make it more generic JavaScript can be used to calculate the height where the Grid needs to fit and set it to the component. 


Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Dan
Top achievements
Rank 1
Iron
Iron
Veteran
Answers by
Viktor Tachev
Telerik team
Dan
Top achievements
Rank 1
Iron
Iron
Veteran
Share this question
or