Hi there
I want to clear my datagridwew without resizing it , i mean that i want to have the same number of rows and collumns , i just want to have emptu cells
how can we do that
thank you
Printable View
Hi there
I want to clear my datagridwew without resizing it , i mean that i want to have the same number of rows and collumns , i just want to have emptu cells
how can we do that
thank you
Hello,
How have you binded your datagridView?
To keep the same number of columns you should set the binding source to nothing.
If you have set the dgv to a binding source, then set the binding source's datasource to nothing.
Code:mybindingSource.DataSource = nothing
Maybe something like this?
vb Code:
r = DataGridView.RowCount DataGridView.Rows.Clear DataGridView.RowCount = r