|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Binding an array to a DropDownListHi all,
I'd like to bind an array to a DropDownList and use the array index as the DataValueField. Is this possible? Thanks, Paul Than array you can bind a collection based class which has values as
objects in that collection class Define a class like Public Class Student { public string Name; public int ID } public Class StudentCollection:System.Collection.CollectionBase { public Student this[int i] { get { return (Student)this.base.List[i] } set { this.base.List[i]=value; } } } And this class could be bound to any controls
Other interesting topics
Space in fileupload control
asp to asp.net conversion asp with membership/login asp:TextBox add a link button to prev/next in a wizard ASP.NET 2.0 - How to databind to nested (hierarchical) business objects? Default Border Color for Dropdownlist Control? Problem woth ObjectDataSource and Dataset... SIMPLE QUESTION Problem with ImageUrlEditor |
|||||||||||||||||||||||