Groups | Blog | Home
all groups > c# > march 2006 >

c# : PropertyBinding an ApplicationSetting to a combo box's members?



Joel Thornton
3/2/2006 11:41:06 PM
Is it possible to use C# 2.0's (VS2005's) PropertyBinding properties to
automatically load an ApplicationSetting (presumably of type
System.Collections.Specialized.StringCollection) so that it auto
populates the drop down list on program startup?

Also, what is the easiest way to save a new item to said
ApplicationSetting when something new has been typed into the combo
box?

Thanks!

Joel
autenzio NO[at]SPAM gmail.com
3/6/2006 9:53:56 AM
Hi Joel - I was trying to do the same thing but since the Items member
is not listed in the available members for binding, I gave up. I wound
creating an ApplicationSetting String Collection containg the values I
wanted loaded in the combobox, then loaded them into the Items
collection by iterating through namespace.Settings1.Default."whatever"
in teh Initialize method.

I know this isn't as nice as setting it up at design time, but at least
this works.

Regards,
Arthur Autenzio
AddThis Social Bookmark Button