Click here to Skip to main content
15,891,905 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have implemented RadGrid in my project for displaying data. But facing one severe issue, when trying to post back or going to the next page, the pager control is shifting down. In order to fix Grid height and width according to the page height and width, i have implemented bellow java script in page load. But unfortunately after post back it is not working.

JavaScript
var grid, gridHeight;
   gridHeight = document.documentElement.offsetHeight - 130;
   grid = $find('<%= GridControl1.FindControl("RadGrid4").ClientID %>');
   if(grid !== null){
        contentPane.set_height(document.documentElement.offsetHeight - 90);  
        grid.get_element().style.height = gridHeight+ "px";
        contentSplitter.repaint();
        grid.repaint();
    }
    else{
        grid = $get('<%= GridControl1.FindControl("RadGrid4").ClientID %>');
        contentPane.set_height(document.documentElement.offsetHeight - 75);
        grid.get_element().style.height = gridHeight+ "px";
        contentSplitter.repaint();
        grid.repaint();
    }

Additionally in else section have tried to fix the height of grid by using bellow given java script, but unfortunately it is not working.
grid.get_element().style.height = gridHeight+ "px";

Kindly suggest, how to fix Grid height in post back so that pager control should not shift down or disappear.

Thanks in advance.
Dipak

What I have tried:

In else section have tried to fix the height of grid by using bellow given java script, but unfortunately it is not working.
grid.get_element().style.height = gridHeight+ "px";
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900