|
-
Jul 22nd, 2007, 03:45 PM
#1
Thread Starter
Member
how to clear a data gridview
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
-
Jul 22nd, 2007, 06:21 PM
#2
Frenzied Member
Re: how to clear a data gridview
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
-
Jul 22nd, 2007, 07:43 PM
#3
Hyperactive Member
Re: how to clear a data gridview
Maybe something like this?
vb Code:
r = DataGridView.RowCount
DataGridView.Rows.Clear
DataGridView.RowCount = r
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|