DataGrid Column Make Invisible

  • Thread starter Thread starter Michael Chong
  • Start date Start date
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
 
Hi Michael:

Setting Visible=False should do the trick. During what event does this
code execute?
 
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
 
Back
Top