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

Resize RadGrid after resizetofit() columns

1 Answer 229 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sean
Top achievements
Rank 1
Sean asked on 10 Apr 2015, 02:04 PM

Hello,

I've used the resizeToFit() function to re-size my columns in the following function:

function pageLoad() {
                var grid = $find('<%= RadGrid2.ClientID %>');
                var master = grid.get_masterTableView();
                var columns = master.get_columns();
                for (var i = 0; i < columns.length; i++) {
                    columns[i].resizeToFit();
                }
            }

Which works very well - however after the re-size I'm left with a ton of white space to the right of my newly sized columns. I know this is cause in part by having static headers however I need to keep the static headers.

So is there a work around to keep the static headers and still re-size the RadGrid to fit the new column size?

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 13 Apr 2015, 10:45 AM
Hi,

This is an existing limitation which appears when resizing with scrolling and static headers are enabled. Then only the GridTableView is resized - RadGrid's width remains fixed. Therefore a blank space to the right is observed. In order to prevent this behaviour you can turn off static headers or leave the control as is, with the ability to add a horizontal scrollbar or empty space on the right.

Regards,
Pavlina
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
Grid
Asked by
Sean
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or