STEVESKI07
Member
- Joined
- Sep 12, 2007
- Messages
- 17
- Programming Experience
- 1-3
Hey everyone,
I have read a few posts similar to my question but can't get any of them to work. Here's my situation...
I have a datagrid with a scroll bar and this is all placed inside a DIV. I want to dynamically change the size of the grid by passing a value from the code behind (# of rows in the grid) to the Javascript function to set the size of the DIV.
I have even resorted to sloppy code just to try to get it working and still can't.
This is the code I put in my VB file:
This is the code I have in my aspx file:
does anybody have any suggestions?
I have read a few posts similar to my question but can't get any of them to work. Here's my situation...
I have a datagrid with a scroll bar and this is all placed inside a DIV. I want to dynamically change the size of the grid by passing a value from the code behind (# of rows in the grid) to the Javascript function to set the size of the DIV.
I have even resorted to sloppy code just to try to get it working and still can't.
This is the code I put in my VB file:
VB.NET:
radSetHeight.Attributes.Add("OnClick", "setDivHeight(i);")
radSetHeight.Checked = True
This is the code I have in my aspx file:
HTML:
<script type="text/javascript">
var divHeight;
function setDivHeight(size)
{
if (size=1)
{
divHeight = 85;
}
else if (size>17)
{
divHeight = 750;
}
else
{
divHeight = 85*size;
}
document.getElementById("divByStateDataGrid").style.height= divHeight;
}
</script>
does anybody have any suggestions?
Last edited by a moderator: