Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Binding a combobox to a business object with an arraylis
Message
From
05/03/2005 10:14:53
 
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
OS:
Windows XP SP2
Miscellaneous
Thread ID:
00992995
Message ID:
00993009
Views:
24
This message has been marked as the solution to the initial question of the thread.
John,

First instantiate an instance of your class, and simply set the combo's data source to it:
TaskType oTask = new TaskType();
this.MyCombo.DataSource = oTask.Types;
~~Bonnie



>Hi,
>I'm pretty new to the concept of n-tier development (and C#) and trying to get my head round the subject.
>
>I've created a simple class with
>
>public class TaskType
>  {
>    private ArrayList _Types = new ArrayList();
>
>    public TaskType()
>        {
>            _Types.Add("Support");
>            _Types.Add("Admin");
>        }
>
>    public ArrayList Types
>        {
>            get { return _Types; }
>            set { _Types.Add(value); }
>        }
>  }
>
>I'd like to get the items of the arraylist TYPES to display in a combobox, and allow new items to be added to the list.
>
>It's not like good old fox, linking to a view)
>Could anyone point me to a good article or website that may assist me in, or provide the required details to bind the TaskType.Types to my combo.
>Many thanks
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform