Last post Sep 27, 2012 10:02 PM by Decker Dong - MSFT
Sep 26, 2012 04:29 PM|jjfrick|LINK
For simplicity, lets say I have a custom details page (SalesPerson) that contains a SaleCarID FK. I want to display more information than a dropdownlist can display such as Make, Model, Year,etc so I have a link that goes to gridview custom page. When the
user selects a row from the gridview I want to replace the SaleCarID in the previous page formview with the new one selected from the gridview. What would be the best way to go about this?
Sep 27, 2012 10:02 PM|Decker Dong - MSFT|LINK
Your Logic is：
1）Choose SaleId (suspected as a primary key) from dropdownlist , besides it shows the only one record bound to the FormView, please also save the primary key into Session.
2) Then when goes to the GridView and when click a button, please in advance to handle the button's click event and fetch the GridView's ((sender) as Button).NamingContainer as GridViewRow).Cell[0-based index] to find out the a new foreign key, and then
us SqlCommand to replace the old one with the new one by using where statement followed by the original primary key from Session.