DropDownList in DataGrid

C

CsaaGuy

Hi, I have a datagrid and each column i have a dropdownlist. I am
populalting these dropdownlists in the itembound event. This part is
working fine. However, when i press the update link, and use the arg e
like this: CType(e.Item.Cells.Item(3).Controls(1),
DropDownList).SelectedItem.Text.Trim. The SelectedItem is always equal
the first item in the dropdownlist, not the one i highlighted. Does
anyone know why the dropdownlist is not returning the selected item?
Thanks.
 
C

CsaaGuy

Yes it does, why should that matter? when an item is highlighted
shouldn't it return the selectedindex of the value regradless?
 
M

Marina

No, what gets posted is the value of the selected item. The dropdown then
finds the first item with that value, and that becomes the selected index.

In any case, that was the only guess I had given the information you posted.
 

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,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top