469,955 Members | 2,423 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,955 developers. It's quick & easy.

clearing a datagrid

Hello,
What is the best method of clearing a datagrid?
I'm having issues with it not 'resetting' when I want to repopulate it.
I usually design my datagrids using the .net toolbar/properties, but had to
create this one programmatically (so I could add comboboxes).
I've never had this problem before, but now, whenever I try to repopulate my
dataset, it keeps my original data, and adds the column headers as new rows.
It seems to me that I just need to 'empty' the datagrid, or clear it
completely before repopulating it.
Any advice?
TIA,
Amber

Feb 22 '06 #1
1 1723
amber wrote:
Hello,
What is the best method of clearing a datagrid?
I'm having issues with it not 'resetting' when I want to repopulate
it. I usually design my datagrids using the .net toolbar/properties,
but had to create this one programmatically (so I could add
comboboxes). I've never had this problem before, but now, whenever I
try to repopulate my dataset, it keeps my original data, and adds the
column headers as new rows. It seems to me that I just need to
'empty' the datagrid, or clear it completely before repopulating it.


clear the bound data containing object, like the bound datatable, then
the grid clears itself. Be sure the object implements IBindingList, so
the grid gets an event that the bound object is cleared. So a normal
ArrayList won't do.

FB

--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Feb 22 '06 #2

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
1 post views Thread by Asha | last post: by
3 posts views Thread by Ed Bick | last post: by
2 posts views Thread by dbuchanan | last post: by
2 posts views Thread by DaveP | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.