Hello,
Can someone please tell me why my datasource is not updating when using the RadGrid? I have read countless forum posts and still have been unable to solve the issue. I wanted to use the AutomaticUpdate/Delete feature, because it appeared to be "simple". I am using the grid to display a user's shopping cart contents. All I want to be able to do is allow them to update the quantity of an item in the cart, or remove it....period.
Below is my code. I have stripped it down to bare bones in hopes to find the problem, but still no luck. This is driving me NUTS!
Any help would be greatly appreciated.
Thanks,
Jim
Code-behind:
Can someone please tell me why my datasource is not updating when using the RadGrid? I have read countless forum posts and still have been unable to solve the issue. I wanted to use the AutomaticUpdate/Delete feature, because it appeared to be "simple". I am using the grid to display a user's shopping cart contents. All I want to be able to do is allow them to update the quantity of an item in the cart, or remove it....period.
Below is my code. I have stripped it down to bare bones in hopes to find the problem, but still no luck. This is driving me NUTS!
Any help would be greatly appreciated.
Thanks,
Jim
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="shoppingcart.ascx.vb" Inherits="ctl_shoppingcart" %><%@ Register Assembly="DevExpress.Web.ASPxEditors.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %><%@ Register assembly="DevExpress.Web.ASPxGridView.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dxwgv" %><%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %><script type="text/javascript"> function showSubDetail(URL) { var oWnd = radopen(URL, "windowItemDetail"); }</script><div class="shoppingcart"> <div class="heading"> Current Items in Your Cart </div> <telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="true" EnableAJAX="true" DataSourceID="SqlDataSource1" AllowAutomaticDeletes="true" AllowAutomaticInserts="true" AllowAutomaticUpdates="true"> <MasterTableView AutoGenerateColumns="False" DataKeyNames="lineID" DataSourceID="SqlDataSource1" EditMode="InPlace"> <Columns> <telerik:GridEditCommandColumn ButtonType="LinkButton" UniqueName="editcolumn"></telerik:GridEditCommandColumn> <telerik:GridBoundColumn DataField="quoteID" DataType="System.Int32" HeaderText="quoteID" UniqueName="quoteID"></telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="lineID" HeaderText="lineID" UniqueName="lineID"></telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="enteredByContactID" HeaderText="enteredByContactID" UniqueName="enteredByContactID"></telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="containersOrdered" HeaderText="containersOrdered" UniqueName="containersOrdered"></telerik:GridBoundColumn> </Columns> </MasterTableView> </telerik:RadGrid> <br /><br /> <telerik:RadButton ID="btnCheckout" Text="Checkout" runat="server"> </telerik:RadButton> <telerik:RadWindowManager ID="RadWindowManager1" runat="server"> <Windows> <telerik:RadWindow ID="windowItemDetail" CssClass="itemDetailWindow" runat="server" Modal="true" Behaviors="Close" Animation="Fade" AnimationDuration="500" width="500" Overlay="true" Title="Assorted Species Tray Detail" VisibleTitlebar="true" VisibleStatusbar="false"> </telerik:RadWindow> </Windows> </telerik:RadWindowManager> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues" ConnectionString="<%$ ConnectionStrings:RakerDBConnectionString %>" SelectCommand="spSelectQuoteDetailInfoByQuoteID" SelectCommandType="StoredProcedure" UpdateCommand="spUpdateQuoteDetailLineByCriteria" UpdateCommandType="StoredProcedure"> <SelectParameters> <asp:Parameter Name="quoteID" Type="Int32" DefaultValue="1229" /> </SelectParameters> <UpdateParameters> <asp:Parameter Name="quoteID" Type="Int32" /> <asp:Parameter Name="lineID" Type="Int32" /> <asp:Parameter Name="containersOrdered" Type="Int32" /> <asp:Parameter Name="enteredByContactID" Type="Int32" /> </UpdateParameters> </asp:SqlDataSource></div>Code-behind:
Imports System.DataImports Telerik.Web.UIPartial Class ctl_shoppingcart Inherits System.Web.UI.UserControlEnd Class