DataGrid Column Make Invisible

M

Michael Chong

Hi,

How can I make a column in Datagrid invisible programmatically during
run-time? I did try the following but doesn't work.

DataGridLedger.DataSource = myDataSet
DataGridLedger.DataMember = "ParentTable"
DataGridLedger.DataBind()
DataGridLedger.Visible = True
DataGridLedger.Columns(1).Visible = False

plz help...!

Michael
 
S

Scott Allen

Hi Michael:

Setting Visible=False should do the trick. During what event does this
code execute?
 
M

Michael Chong

Hi Scott,

During when a user click a button, then my code will generate the data
dynamically create the dataset and show it in the datagrid, so I would like
to hide the ID field. I did use the Visible property but it doesn't seem
working. Maybe the way I allocate the Visible property is in the wrong line,
do you think so? Please advice. TQ

Michael
 

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,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top