none
set selected index of dropdown in update panel RRS feed

  • Question

  • I have ASP.net application. in that i am using update pane. update panel contains HTMLTable where each row consist of label,dropdown and add button. whenever we add new row table gets sorted in ascending order and renders. and sorting is done by the value in lable field. when we give add new record with the lable value as 'Vtest' and suppose dropdown value as 'A' then record gets added at correct position with the previous records. but as soon as you add new record with the value lesser then previous, suppose if you add record with lable value 'Ctest' and dropdown value as 'T' then record get added at correct position but the dropdown value changes means instead of value 'T' it shows me the selected value as 'A' which is the value of next record's dropdown.

    If i add record whose value is greater than 'Vtest' suppose if i add record with lable value 'Wtest' and dropdown value 'C' then record gets added at correct position with correct value selected in a dropdown.

    I am not getting where the problem is actually. in case of code it returns the table with proper values but while rendering it shows wrong value of newly added record with smaller value. i have tried all Update Panel modes also. but it's of no use.

    Tuesday, December 27, 2011 1:02 AM

All replies