Using DropDownList in EditTemplates of a GridView

Posted by vaibhav on Stack Overflow See other posts from Stack Overflow or by vaibhav
Published on 2010-03-08T15:16:54Z Indexed on 2010/03/08 15:51 UTC
Read the original article Hit count: 778

Filed under:
|
|
|
|

I am working on a GridView in Asp.Net. When initially a the Page Loads, my gridview look like: alt text

When a user clicks, to edit a row, I am using edit templates to show 'Domain' in a DropDownList. But problem is , when the DropDownlist gets load with data, it lost the current value of the 'Domain'.
i.e If I want to edit 4th Row, its domain which is currently set to 'Computers' is getting changed to 'MBA' which is ofcourse the first element return by the DataSource. alt text


I want to display the current value ('computers') as the selected value in DropDownList. But I am unable to get the value of Domain, which is being edited.

© Stack Overflow or respective owner

Related posts about .NET

Related posts about gridview