Binding asp:DropDownList on asp:Repeater

G

Goncalo Faria

Hi.

I'll go directly to my problem:

I have a repeater that is binded with data.

For each data row I want the user to be able to change a
field, that is represented by a DropDownList.

My problem is that when binding the DropDownList I am not
able to select a default item that is at an index != 0
(zero).

Here is the code when binding the dropdown:

_dropdown.DataSource = _dataTable
_dropdown.DataTextField = "myTextField"
_dropdown.DataValueField = "myValueField"
_dropdown.DataBind()

_dropdown.Items.FindByValue(_myValue).Selected = True

these instructions are called in an overload method that
is triggered everytime a repeater item is created.

Any ideas?
If you want me to be more specific, pleas reply...

thank's in advance
goncalo
 

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,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top