By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,344 Members | 1,139 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,344 IT Pros & Developers. It's quick & easy.

Clearing data from a DataGrid

P: n/a
I've got to be missing something very simple here, but I'm stumped. I have a
DataGrid control on a form. The form allows search of a database and display
of resulting rows in the DataGrid.

My problem is, when the user does a second search, the results of the first
search remain in the DataGrid, and the results of the second search are just
added below. I've tried setting the DataSource property to Nothing and
refreshing the DataGrid, but it doesn't seem to do anything.

Any help would be appreciated.

Thanks!
Mar 31 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi,

Are you clearing the dataset before you refill it?

Ken
----------
"DaveP" <Da***@discussions.microsoft.com> wrote in message
news:4E**********************************@microsof t.com...
I've got to be missing something very simple here, but I'm stumped. I
have a
DataGrid control on a form. The form allows search of a database and
display
of resulting rows in the DataGrid.

My problem is, when the user does a second search, the results of the
first
search remain in the DataGrid, and the results of the second search are
just
added below. I've tried setting the DataSource property to Nothing and
refreshing the DataGrid, but it doesn't seem to do anything.

Any help would be appreciated.

Thanks!

Mar 31 '06 #2

P: n/a
Thanks Ken. You got it exactly right. I realized I wasn't doing that, and
just came out here to "rescind" my question. Thanks for taking the time to
answer.

"Ken Tucker [MVP]" wrote:
Hi,

Are you clearing the dataset before you refill it?

Ken
----------
"DaveP" <Da***@discussions.microsoft.com> wrote in message
news:4E**********************************@microsof t.com...
I've got to be missing something very simple here, but I'm stumped. I
have a
DataGrid control on a form. The form allows search of a database and
display
of resulting rows in the DataGrid.

My problem is, when the user does a second search, the results of the
first
search remain in the DataGrid, and the results of the second search are
just
added below. I've tried setting the DataSource property to Nothing and
refreshing the DataGrid, but it doesn't seem to do anything.

Any help would be appreciated.

Thanks!


Mar 31 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.