Remove column from a DataGrid?

  • Thread starter Thread starter Bruce W.1
  • Start date Start date
B

Bruce W.1

I've got a dataset with a couple of table columns that I don't want to
show in a DataGrid. But I want to leave the columns in the dataset.

I passed the DataSet thru a DataView, but I can't figure out how this
might work.

There are tons of examples out there on how to filter rows out of the
table. I cannot however find one that shows how to filter columns.

Can anyone point me to information on this, or tell me how to do it?

Thanks for your help.
 
Hi Bruce,

Inactivate the visibility of the cells you want in the ItemCreated event.
The following example assumes the use of a datagrid control named DataGrid1.
It will make the first cell -- .Cells(0). -- invisible:

Private Sub DataGrid1_ItemCreated(ByVal sender As Object, ByVal e As
DataGridItemEventArgs) Handles DataGrid1.ItemCreated
e.Item.Cells(0).Visible = False
End Sub

Good Luck,
Antoni
 
Back
Top