471,086 Members | 826 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,086 software developers and data experts.

Clearing data from a DataGrid

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
2 1354
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
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.

Similar topics

reply views Thread by Gary | last post: by
3 posts views Thread by Dan | last post: by
3 posts views Thread by Brad | last post: by
5 posts views Thread by Alvin Bruney | last post: by
3 posts views Thread by Ed Bick | last post: by
2 posts views Thread by dbuchanan | last post: by
1 post views Thread by amber | last post: by
8 posts views Thread by cj | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.