Re: How to refresh a DataGrid?
From: Nicholas Paldino [.NET/C# MVP] (mvp_at_spam.guard.caspershouse.com)
Date: 10/19/04
- Next message: Matthias S.: "Easiest way to copy values from a collection to an array?"
- Previous message: Nick Malik: "Re: Is this possible..."
- In reply to: Skip: "How to refresh a DataGrid?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 19 Oct 2004 10:52:33 -0400
SC,
You could set the DataSource of the grid to null, and then back to the
list. This is the hacky way.
If you wanted the grid to update when changes are made, then implement
the IBindingList interface, which has an event that you fire when changes
are made to your list.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
"Skip" <Skip@discussions.microsoft.com> wrote in message
news:9FD9B92E-AD6F-459F-B905-010C0364B16C@microsoft.com...
> Hi,
>
> This might be the easiest question ever but I can't seem to find how to do
> it: I have a DataGrid that's linked to an instance of IList (actually,
> it's
> an ArrayList). On load, there's already data in the collection so when I
> call the DataGrid's 'SetDataBinding' method, the DataGrid displays the
> data
> correctly.
>
> Problem is that when I add data to the collection afterwards, I can't
> display it in the DataGrid. I tried calling its 'Refresh' method, its
> 'Update' method and even the 'SetDataBinding' method again without
> success.
>
> Basically, in this case, how can I refresh the data in a DataGrid once the
> source has changed?
>
> Thanks,
>
> SC
- Next message: Matthias S.: "Easiest way to copy values from a collection to an array?"
- Previous message: Nick Malik: "Re: Is this possible..."
- In reply to: Skip: "How to refresh a DataGrid?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|