How to Stretch DataGrid at Runtime?

T

Tyrant Mikey

I ahve a page that contains a DataGrid control that is offset from the
left-hand side of the page by about 100 pixels. What I want to do is
stretch the DataGrid to fill the remainder of the page width as the
user resizes the window.

I have tried the following, to no avail:

<SCRIPT language="javascript">
void ResizeGrid() {
document.all.grdManifests.style.width = document.body.clientWidth -
150;
}
</SCRIPT>

<BODY onresize="ResizeGrid()">
..
..
..
</BODY>

Can anyone tell me what I'm doing wrong? Thanks!
 
J

Joshua Flanagan

You could try overriding the TABLE tag created by the DataGrid control
to set the WIDTH="100%" attribute. If it doesn't expose a property to
control this behavior, you probably need to create a new control derived
from DataGrid, and override part of the rendering.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top