Question : DropDownList in DetailsView - ASP.NET C# codebehind

Hello,
This may seem silly, but I am pulling my hair out trying to figure out how to display a record my detailsview when the user chooses a different item from the DropDownList. currently, the DDL will populate and I can choose an item, but i have no clue how to get it to change the rest of the data in the details view based on the value I selected from the DDL.
the DDL is NOT the primary key, but I want the rest of that particular record to show up in the other fields of that details view for the choice I made in the DDL.
Please help!
Please ask if you are unclear what I am trying to do here. please feel free to laugh at me if this is too easy :)
Thank you!

Answer : DropDownList in DetailsView - ASP.NET C# codebehind

on ddl_selectedindexchanged event,

loop gridview rows and if the record id is equal to the ddl.selecteditem.value, then make taht rows.selected=true

or set detailsview.rows.selectedValue = ddl.selecteditem.value

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.detailsview.selectedvalue.aspx
Random Solutions  
 
programming4us programming4us