TedN Posted March 29, 2007 Posted March 29, 2007 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 Quote
TedN Posted March 30, 2007 Author Posted March 30, 2007 Duh! I was removing column before making datagridview visible. Make it visible first and column can be removed. Quote
amir100 Posted April 4, 2007 Posted April 4, 2007 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 Quote Amir Syafrudin
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.