views:

264

answers:

1

In Asp.Net 3.5, it is possible that the DataValueField is a IList ?

myddl.DataValueField = "ListOfId"

where ListOfId as a IList in my DataSource

A: 

It's not possible. DataValueField must be a string, that is the name of a public property of the binded datasource:

http://msdn.microsoft.com/en-en/library/system.web.ui.webcontrols.listcontrol.datavaluefield(VS.90).aspx

If you have a simple list of string you can just bind it to the dropdown:

http://stackoverflow.com/questions/247856/c-dumping-a-list-to-a-dropdownlist

mamoo