Re: ComboBox DataSource - on the fly changes?
- From: "Nicholas Paldino [.NET/C# MVP]" <mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 19 Oct 2005 14:48:11 -0400
cj,
Instead of binding to an ArrayList, create a shell for the ArrayList
which implements IBindingList and binds to that.
Or, in .NET 2.0, use the generic BindingList class and bind to that.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx
"cj" <chriscsharp@xxxxxxxxxxxxxxxx> wrote in message
news:OVeSPdN1FHA.4064@xxxxxxxxxxxxxxxxxxxxxxx
>I have a ComboBox that I populate using a DataSource (an ArrayList of
>objects of the same type.)
>
> When I add and remove items in the data source array list, I can't get the
> list of items shown in the ComboBox to update automatically. I had
> trouble getting the DataSource to take when I first created this ComboBox
> (a few weeks ago), and the only way I found to get it to work is to set
> the Parent property (and then I handled the ParentChanged event and set
> the DataSource, DisplayMember, ValueMember, etc., there.
>
> Do I have to set the Parent every time I make changes to the DataSource to
> get the ComboBox to repopulate, or is there a better way?
>
> Thanks,
> cj
>
.
- Prev by Date: Re: writing RightToLeft to files
- Next by Date: Re: Handling events from User Control
- Previous by thread: Re: writing RightToLeft to files
- Next by thread: can't write to newly created file - file being used by another process
- Index(es):
Relevant Pages
|