C
Chris Szabo
Good morning everyone. I have a problem right now using the GridView control
with and ObjectDataSource. It appears as though the new values are not being
passed to the update method, only the original values.
I've stepped through the code, and I can see the new values correctly in the
GridView control, but when the Update method for the ODS is invoked, the
appropriate vales are not passed to the method.
Here is the markup:
<asp:GridView
OnPreRender="gvBom_OnPreRender"
DataSourceID="odsGridSource"
CssClass="dataGrid"
Width="100%"
AutoGenerateColumns="False"
CellPadding="5"
HorizontalAlign="Left"
AutoGenerateEditButton="True"
ID="gvBom"
runat="server">
<RowStyle CssClass="dataGridItemRow" Font-Size="X-Small" />
<HeaderStyle BackColor="#F8F8F8" />
<Columns>
<asp:BoundField Visible="false" DataField="ProductId" />
<asp:BoundField HeaderText="Product"
DataField="PartNumber" />
<asp:BoundField HeaderText="Qty" DataField="Quantity" />
<asp:BoundField HeaderText="Manufacturer"
DataField="Manufacturer" />
<asp:BoundField HeaderText="Clarification"
DataField="Clarification" />
<asp:BoundField HeaderText="Qty Available"
DataField="QuantityAvailable" />
<asp:BoundField HeaderText="Date Available"
DataField="DateAvailable" />
<asp:BoundField HeaderText="Extension"
DataField="Extension" />
</Columns>
</asp:GridView>
<asp:ObjectDataSource
ID="odsGridSource"
runat="server"
UpdateMethod="UpdateBomAddedProduct"
SelectMethod="GetBomAddedProduct"
TypeName="UI.BT.BOM.Processor" >
<UpdateParameters>
<asparameter Name="ProductId" Type="Int64" />
<asparameter Name="PartNumber" Type="String" />
<asparameter Name="Quantity" Type="Int32" />
<asparameter Name="Manufacturer" Type="String" />
<asparameter Name="Clarification" Type="String" />
<asparameter Name="QuantityAvailable" Type="Int32" />
<asparameter Name="DateAvailable" Type="DateTime" />
<asparameter Name="Extension" Type="Int32" />
</UpdateParameters>
</asp:ObjectDataSource>
And this is the prototype for the method that is invoked in the business tier:
public static void UpdateBomAddedProduct (
Int64 ProductId,
string PartNumber,
int Quantity,
string Manufacturer,
string Clarification,
int QuantityAvailable,
DateTime DateAvailable,
int Extension )
{ }
If a break point is set on this method, it will be hit. But the values
being passed are the old values, not the updated values. Does anyone have
any ideas on why this would happen?
Thanks
with and ObjectDataSource. It appears as though the new values are not being
passed to the update method, only the original values.
I've stepped through the code, and I can see the new values correctly in the
GridView control, but when the Update method for the ODS is invoked, the
appropriate vales are not passed to the method.
Here is the markup:
<asp:GridView
OnPreRender="gvBom_OnPreRender"
DataSourceID="odsGridSource"
CssClass="dataGrid"
Width="100%"
AutoGenerateColumns="False"
CellPadding="5"
HorizontalAlign="Left"
AutoGenerateEditButton="True"
ID="gvBom"
runat="server">
<RowStyle CssClass="dataGridItemRow" Font-Size="X-Small" />
<HeaderStyle BackColor="#F8F8F8" />
<Columns>
<asp:BoundField Visible="false" DataField="ProductId" />
<asp:BoundField HeaderText="Product"
DataField="PartNumber" />
<asp:BoundField HeaderText="Qty" DataField="Quantity" />
<asp:BoundField HeaderText="Manufacturer"
DataField="Manufacturer" />
<asp:BoundField HeaderText="Clarification"
DataField="Clarification" />
<asp:BoundField HeaderText="Qty Available"
DataField="QuantityAvailable" />
<asp:BoundField HeaderText="Date Available"
DataField="DateAvailable" />
<asp:BoundField HeaderText="Extension"
DataField="Extension" />
</Columns>
</asp:GridView>
<asp:ObjectDataSource
ID="odsGridSource"
runat="server"
UpdateMethod="UpdateBomAddedProduct"
SelectMethod="GetBomAddedProduct"
TypeName="UI.BT.BOM.Processor" >
<UpdateParameters>
<asparameter Name="ProductId" Type="Int64" />
<asparameter Name="PartNumber" Type="String" />
<asparameter Name="Quantity" Type="Int32" />
<asparameter Name="Manufacturer" Type="String" />
<asparameter Name="Clarification" Type="String" />
<asparameter Name="QuantityAvailable" Type="Int32" />
<asparameter Name="DateAvailable" Type="DateTime" />
<asparameter Name="Extension" Type="Int32" />
</UpdateParameters>
</asp:ObjectDataSource>
And this is the prototype for the method that is invoked in the business tier:
public static void UpdateBomAddedProduct (
Int64 ProductId,
string PartNumber,
int Quantity,
string Manufacturer,
string Clarification,
int QuantityAvailable,
DateTime DateAvailable,
int Extension )
{ }
If a break point is set on this method, it will be hit. But the values
being passed are the old values, not the updated values. Does anyone have
any ideas on why this would happen?
Thanks