DropDownList (bind)

G

Goncalo Faria

Hi.

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.


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

Forum statistics

Threads
473,787
Messages
2,569,631
Members
45,338
Latest member
41Pearline46

Latest Threads

Top