Hidden columns in execution time

W

Wallace Santos

Hi,

I have one datagrid where the columns are mounted in execution time and use
a column template where exists a link. One necessary to make that the second
column of grid that is mounted in execution time become hidden.

Someone help me?

And excuse my english errs
 
P

Paul

I'm going to assume that you have a datagrid with only 2 columns, the 1st
one you want displayed, they 2nd one you want hidden.

If you are letting the datagrid automatically generate the columns at
runtime, you would put something like this in your Page_Load handler:

MyDataGrid.Columns[1].Visible = false; // rows/columns index starting
at 0.

If you have set AutoGenerateColumns to false for your datagrid, just go to
the datagrid's Collections property, open up the dialog, go to the "Columns"
page and uncheck "Visible" for the column you want to hide.

HTH.

Paul
 
W

Wallace Santos

thank's Paul, but this did not decide my problem and i already had attemped
to apply this solution.

I have a column with hyperlink where it must receive the page from
destination and field ID of the data base but does not have to show column
ID

As this pagina makes search for many different pages the connection with the
DB was not carried through in development time

If I to use an XML file, it would be more easy?

Thank's again



Paul said:
I'm going to assume that you have a datagrid with only 2 columns, the 1st
one you want displayed, they 2nd one you want hidden.

If you are letting the datagrid automatically generate the columns at
runtime, you would put something like this in your Page_Load handler:

MyDataGrid.Columns[1].Visible = false; // rows/columns index starting
at 0.

If you have set AutoGenerateColumns to false for your datagrid, just go to
the datagrid's Collections property, open up the dialog, go to the "Columns"
page and uncheck "Visible" for the column you want to hide.

HTH.

Paul

Wallace Santos said:
Hi,

I have one datagrid where the columns are mounted in execution time and use
a column template where exists a link. One necessary to make that the second
column of grid that is mounted in execution time become hidden.

Someone help me?

And excuse my english errs
 
E

Eliyahu Goldin

Wallace,

You can make it with stylesheets. For the columns you want to hide set
CssClass="Invisible" and define Invisible in a stylesheet as
..Invisible {display:none}

Eliyahu
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top