|
-
Oct 6th, 2008, 09:20 AM
#1
Thread Starter
Member
Clearing Data Grid
Version: 2003
The datagrid processing works. The problem is that when I make a second selection to populate the data grid, the existing data does not get cleared. I have tried clearing the table, clearing the select command statement, and various other techniques. Nothing works.
Does anybody have any ideas.
Thanks in advance.
-
Oct 6th, 2008, 12:05 PM
#2
Re: Clearing Data Grid
Have you tried calling Refresh on the datagrid after refreshing the data?
 I always add to the reputation of those whose posts are helpful, and even occasionally to those whose posts aren't helpful but who obviously put forth a valiant effort. That is, when the system will allow it.
My war with a browser-redirect trojan
-
Oct 6th, 2008, 12:11 PM
#3
Thread Starter
Member
Re: Clearing Data Grid
Mr Dolot,
dgECLLines.TableStyles.Clear()
dgECLLines.Refresh()
dgECLLines.TableStyles.Add(aGridTableStyleECLLines)
dgECLLines.DataSource = ds
dgECLLines.DataMember = "ECLL02"
As you can see, the refresh is there, but still does not clear. I am open to any suggestions.
Thanks for Trying.
-
Oct 6th, 2008, 12:41 PM
#4
Re: Clearing Data Grid
I would try putting the refresh after the setting of the dataMember.
 I always add to the reputation of those whose posts are helpful, and even occasionally to those whose posts aren't helpful but who obviously put forth a valiant effort. That is, when the system will allow it.
My war with a browser-redirect trojan
-
Oct 6th, 2008, 12:51 PM
#5
Thread Starter
Member
Re: Clearing Data Grid
Made the change- same results - added the items from second requested to bottom of first request.
dgECLLines.TableStyles.Clear()
dgECLLines.TableStyles.Add(aGridTableStyleECLLines)
dgECLLines.DataSource = ds
dgECLLines.DataMember = "ECLL02"
dgECLLines.Refresh()
-
Oct 7th, 2008, 12:16 PM
#6
Re: Clearing Data Grid
And this is the same code that gets called the first time and it works, but not the second time?
 I always add to the reputation of those whose posts are helpful, and even occasionally to those whose posts aren't helpful but who obviously put forth a valiant effort. That is, when the system will allow it.
My war with a browser-redirect trojan
-
Oct 7th, 2008, 12:26 PM
#7
Thread Starter
Member
Re: Clearing Data Grid
I set the table in a different data set and I changed the order of the statements and that seems to have solved the problem.
Thanks for the help.
-
Oct 7th, 2008, 12:42 PM
#8
Re: Clearing Data Grid
You do realize that all you are clearing is the table style... not the data, right? Best way I found to get it to clear is to set the DataSource to nothing, call grid.rows.clear, then reset the dataasource, the datamember (although I'm usually jsut binding a datatable, making this moot) and calling .Refresh.
-tg
-
Oct 7th, 2008, 12:45 PM
#9
Thread Starter
Member
Re: Clearing Data Grid
Yes is do realize the I am clearing the table style. Part of the code that I did not send you was dealing with the table style.
I really appreciate all you time.
Thanks again
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
|