I have a grid that receives products over a GetList methods via ObjectDataSource. The Product class contains also a Object Supplier. If I change in the drop down list of the grid the supplier for a product and I click update the ID of the suppliier is still the same. I have debugged the call of the update method and checked the parameter in the product object.
I wrote the following code in the SelectedIndexChanged event and the text box shows the right id but not the update method.
DropDownList supplier = (DropDownList) sender;
txtTest.Text = supplier.SelectedValue;
Here is the code of my grid view:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="odsParts" CellPadding="3" AllowPaging="True"
CaptionAlign="Left" Width="700px" DataKeyNames="ID,Supplier">
<asp:CommandField ShowSelectButton="True" />
<asp:BoundField DataField="Description" HeaderText="Description"
<asp:TemplateField HeaderText="Supplier" SortExpression="Supplier.CompanyName">
View Complete Post