Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
498
change height of ultrawebgrid to the height of the browser
posted

This is the code i used

   var gridID;

function UltraWebGrid1_InitializeLayoutHandler(gridName){

    gridID = gridName;

 

    setGridHeight();

}

function setGridHeight(){    var myHeight = getWindowHeight() - 100;

 

    var grid = igtbl_getGridById(gridID);

    grid.resize(750, myHeight);

}

function getWindowHeight() {

    var myWidth = 0, myHeight = 0;

    if( typeof( window.innerWidth ) == 'number' ) {

        //Non-IE

       myWidth = window.innerWidth;

       myHeight = window.innerHeight;

    }
else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {

        //IE 6+ in 'standards compliant mode'

        myWidth = document.documentElement.clientWidth;

        myHeight = document.documentElement.clientHeight;

    }
else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {

       //IE 4 compatible

       myWidth = document.body.clientWidth;

       myHeight = document.body.clientHeight;

    }

    return myHeight;

}

 

This seems to work for grid containing few rows, but if the number of rows exceeds even 20, the height of the grid turns out to be greater than the height of the browser.

Why isn't this working and is there any other way for me to do what i need? Any help will be appreciated.

Thank you,

Parents
  • 90
    posted

    This may help - we found the doctype created by VS 2005 by default was messing up our grids.  We use this one instead from VS 2003:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > 

    Hope this helps. 

Reply Children