P
Parodi Development
Hi,
I have a Custom Collection (derived from NameValueCollection) that contains
Items of type Person with 3 properties : Name, Surname, DateOfBirth.
I use the following code :
PersonCollection pCol = new PersonCollection();
.... Fill Collection with Person objects..
Then in a WebPage with a DropdownList named dropDown1 I use :
private void page_load()
{
dropDown1.DataSource = pcol;
dropDown1.DataTextValue = "Name";
dropDown1.DataFieldValue = "DateOfBirth"
dropDown1.DataBind();
}
And I still can't get it to work.. Any idea on how to bind a custom
collection to a dropdownList and then specify which property to have
displayed as text in the dropdown and which property to store the value I
need to get back after user selection ???
Thanks in advance.
I have a Custom Collection (derived from NameValueCollection) that contains
Items of type Person with 3 properties : Name, Surname, DateOfBirth.
I use the following code :
PersonCollection pCol = new PersonCollection();
.... Fill Collection with Person objects..
Then in a WebPage with a DropdownList named dropDown1 I use :
private void page_load()
{
dropDown1.DataSource = pcol;
dropDown1.DataTextValue = "Name";
dropDown1.DataFieldValue = "DateOfBirth"
dropDown1.DataBind();
}
And I still can't get it to work.. Any idea on how to bind a custom
collection to a dropdownList and then specify which property to have
displayed as text in the dropdown and which property to store the value I
need to get back after user selection ???
Thanks in advance.