Extra "DataValueFields" in custom DropDownList

G

groovyghoul

Hi

I am building a custom databound dropdownlist, and I would like to have
more than one "DataValueField". I would name them DataValueField2,
DataValueField3, etc.

I'm having trouble figuring out how I would bind to them.

Any help would be appreciated. Thanks.

- Richard
 
T

Teemu Keiski

Hi,

you would if course get them from the property into a string array by
splitting the given string value (containing "DataValueField2,
DataValueField3"). Thewn when you need to get the corresponding data, loop
through the string array and use DataBinder.Eval(dataitem, arrayitem) to get
the field objecty from data source item (this happens in a loop which
enumerates the data source)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top