Does it makes sense that when columns of a datagridview are clea开发者_Go百科red, all rows are removed?
In a table display such a s DataGridView, if there are no columns, there cannot be any rows, and vice versa.
If you are removing all of the columns, then there can be no rows associated with them. You'd need at least one column in order to have rows.
Why don't you just toggle visibility on the column instead?
dgv.Columns[sColumnName].Visible
精彩评论