Reference DataGrid Style Property in Javascript

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi. I have the following Javascript function on an aspx page, in the HTML
code. As you can see, if the condition is true then 3 lines of code are
executed. My problem is that I cannot get the third line to work.
DataGrid1's style does not update as the Javascript specifies. Is this
formatted correctly? If not, please advise how I can correct this. Thanks!

function change()
{
if (xyz.style.display=="none")
{
xyz.style.display="block"
document.all.Image1.src = 'collapse.gif'
document.all.DataGrid1.style = 'Z-INDEX: 101; LEFT: 8px; POSITION: absolute;
TOP: 240px'
}
 
Why don't you do this in your VB code?


If xyz.Style.Item("display") = "none" Then
xyz.Style.Style.Item("display") = "block"
DataGrid1.Style.add("Z-INDEX","101")
DataGrid1.Style.add("LEFT","8px")
.. etc ..
End If

Good Luck,
Ricky
 

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

Back
Top