Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Binding a combobox to a business object with an arraylis
Message
De
05/03/2005 10:14:53
 
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
OS:
Windows XP SP2
Divers
Thread ID:
00992995
Message ID:
00993009
Vues:
26
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform