问题描述:

We have a system.web.ui.webcontrols.gridview in a aspx file which has several columns includingtextboxes, labels and comboboxes.

We get the textboxes in a java script file using(document.getElementById())to use the values for our calculation and set the results to some other textboxes in the gridview.

Now dues to lack of space we need to hide some columns that user do not need to see their values(we still need to read/write the values).

To hide the desired columns in the gridview i set theVISIBLEto the false and it hides the columns, but the problem is that when I make a column invisible ,document.getElementById()` returns nothing and then we can not set the results to the invisible textboxes.

Is there any other way to hide the columns and keep using them in the background ?

Thank you in advanced.

Br,

Navid

网友答案:

You can add style to those columns and they will remain in background

style="display:none";

or you can assign a css class to those columns and in class you can write display:none

网友答案:

just use javascript to set display to none then it hides and its value is accessable

 document.getElementById("myDIV").style.display = "none";
相关阅读:
Top