views:

96

answers:

3

Does it makes sense that when columns of a datagridview are cleared, all rows are removed?

A: 

In a table display such a s DataGridView, if there are no columns, there cannot be any rows, and vice versa.

Jamie
First I was somewhat surprised that all my rows were gone after clearing the columns. But when I think about it, it does makes sense :)
Martijn
A: 

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.

Ardman
A: 

Why don't you just toggle visibility on the column instead?

dgv.Columns[sColumnName].Visible
Ken