i have an arraylist which holds my Customer object, that contains the
customer details, but when i try binding it to a dropdown box, i cant get
the values to appear..
this is what i tried:
customerList.DataSource = Customer.GetAdminList()
customerList.DataBind()
customerList.DataTextField = CType(customerList.DataSource,
Customer).Email.ToString
customerList.DataValueField = CType(customerList.DataSource,
Customer).CustomerID.ToString
customerList.Items.Insert(0, "--ALL CUSTOMERS--")
this error returns me a invalid cast error..so i also tried the normal
method:
customerList.DataSource = DotcoCustomer.GetAdminList()
customerList.DataBind()
customerList.DataTextField = "email"
customerList.DataValueField = "customerID"
customerList.Items.Insert(0, "--ALL CUSTOMERS--")
but this populates the dropdown list with the the values
"Web2004.Customer" - which is my application namespace.Object...??
any help appreciated,
Paul.Rearrange the order of your code:
customerList.DataSource = DotcoCustomer.GetAdminList()
customerList.DataTextField = "email"
customerList.DataValueField = "customerID"
customerList.DataBind()
customerList.Items.Insert(0, "--ALL CUSTOMERS--")
"Paul M" <milsnips@.hotmail.com> wrote in message
news:uf9aWLvQEHA.3568@.TK2MSFTNGP10.phx.gbl...
> hi there,
> i have an arraylist which holds my Customer object, that contains the
> customer details, but when i try binding it to a dropdown box, i cant get
> the values to appear..
> this is what i tried:
> customerList.DataSource = Customer.GetAdminList()
> customerList.DataBind()
> customerList.DataTextField = CType(customerList.DataSource,
> Customer).Email.ToString
> customerList.DataValueField = CType(customerList.DataSource,
> Customer).CustomerID.ToString
> customerList.Items.Insert(0, "--ALL CUSTOMERS--")
> this error returns me a invalid cast error..so i also tried the normal
> method:
>
> customerList.DataSource = DotcoCustomer.GetAdminList()
> customerList.DataBind()
> customerList.DataTextField = "email"
> customerList.DataValueField = "customerID"
> customerList.Items.Insert(0, "--ALL CUSTOMERS--")
>
> but this populates the dropdown list with the the values
> "Web2004.Customer" - which is my application namespace.Object...??
> any help appreciated,
> Paul.
0 comments:
Post a Comment