Hello.
I have some code in place to resize the grid when the browser window resizes. I have a jscript method hooked up to the onresize event of the <body> tag.
Inside that method I call the resize(width, height) method of the grid. The problem is that I only want to change the height. I don't ned to mess with the width because it is set at design time to be 100% so that it expands to the total width of the browser.
Is there a way to do that?
Thanks in advance.
Hi.
After spending some time on this issue, I found a solution. The resize() function changes the width of the grid first and then changes the height. I copied that implementation and removed the code that changes the widht. You have to hook up the onresize event of the form to the OnResized() function defined in the jscript block. the <body> tag should look like this:
<body onresize="OnResized()">
Here's the whole jscript code I'm using:
// Global variable to store the id of the grid
// Event handler for the InitializeLayout client-side event
{
// Store the id of the grid
gridID = gridName;
// Adjust the grid's height for the first time
OnResized();
}
// Function to adjust the height of the grid represented by gridID.
// The grid will adjust to the current height of the browser
myWidth = window.innerWidth;
myHeight = window.innerHeight;
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
gridHeight = myHeight - 300;
gridHeight = 300;
marginHeight += grid.MainGrid.rows[x].offsetHeight;
gridHeight = marginHeight;
document.getElementById(grid.Id +
Hi,
I am using same code as describe above but at last done grid.show()
Now It works fine for IE7 and firefox but In IE6 auto resize functionality for rows is not working.
Means when any cell have multiline data (when wrap required) data cut off for IE6
To solve this I have removed RowHeightDefault property for IE6
if (this._page.Request.Browser.Type != "IE6") this.DisplayLayout.RowHeightDefault = Unit.Pixel(20);
Now data cut off issue is Solved but Now when there are few rows (two or three rows ) in grid then after following two lines execute
grid.MainGrid.style.height = gridHeight + "px";
document.getElementById(grid.Id + "_mc").style.height = (gridHeight - marginHeight) + "px";
OffesetHeight is changed for row selector element to gridheight/no of rows
So My row height will be for example 600/3 =200 approx
How to Solve this data cut off issue for IE6 with resize code ?
How to Solve this data cut off issue for IE6 with resize code?