Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Is there a way to remove a column from a DataGridView.

 

I fill the datagridview from a dataset. The dataset has a column of data that I no longer require.

 

I've tried getting rid of the column in the dataset without success.

ds.Tables("Asset").Columns(6).Dispose() doesn't appear to do anything.

 

So I then tried to remove the column from the datagridview.

 

I've tried:

dgPrio.Columns.Remove("CLASS")

dgPrio.Columns.RemoveAt("CLASS")

 

and various other combinations.

 

All that happens is the column I wish to remove moves to the end.

 

Appreciate any help.

 

 

Thanks,

Ted

Posted

Not that I'm trying to deny the fact but I have never thought there's any relation between the visibility and the columns of a datagridview.

 

Weird. :p

Amir Syafrudin

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...