This is the code i used
var gridID;
gridID = gridName;
setGridHeight();
}
var grid = igtbl_getGridById(gridID);
grid.resize(750, myHeight);
var myWidth = 0, myHeight = 0;
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
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,
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.
The following forum posts provides some additional information and sample code that can be useful in your case as well
http://forums.infragistics.com/forums/p/9224/36093.aspx#36093
This may also be related and helpful:
http://forums.infragistics.com/forums/p/2726/16560.aspx#16560
Hope this help.
Thanks for the links.I used those forums to get an idea of how to resize the grid size depending on the window size.
My problem is that it doesn't seem to work for grids containing a lot of rows (10 or more). Why is that? I'm unable to fix it.
Please help!
Well, this is a tricky topic and really depends on a lot of things, for example browser, DOCTYPE, etc, etc. I can suggest a few things:
1) The CSOM resize() method documented here:
http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/WebGrid_Object_CSOM.html
2) Following this thread and using the resizeGrid() method suggested by "lallebob"
http://forums.infragistics.com/forums/p/4326/20947.aspx#20947
If you look at my inital post, i'm using the resize() method.
It resizes the grid if the number of rows is less but if the number of rows is a lot more i.e. if the grid gets longer than the window's height, it doesn't seem to set a fixed height that corresponds to the height of the window.
Anyone?
Can you try following:
Enclose the grid in a div tag and set the height of div tag dynamically based on window size.
Set the following properties for the grid:
<FrameStyle Height="100%"../>
< /DisplayLayout>
I think this should work.
Thank you Asairam, that worked!!
Good to hear that.
Can you use the "Answer" button and the star ratings to mark your problem as solved?