Grid Update Not Working

4 posts, 0 answers
  1. Jim
    Jim avatar
    8 posts
    Member since:
    Sep 2010

    Posted 11 Apr 2011 Link to this post

    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


    <%@ 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.Data
    Imports Telerik.Web.UI
     
    Partial Class ctl_shoppingcart
        Inherits System.Web.UI.UserControl
     
    End Class
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 12 Apr 2011 Link to this post

    Hello Jim,

    Please take a look at the following Code Library which shows how to perform Automatic opeartions using SqldataSource control.
    Automatic operations with SqlDataSource control

    Hope this helps,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jim
    Jim avatar
    8 posts
    Member since:
    Sep 2010

    Posted 13 Apr 2011 Link to this post

    Hello Princy,

    Thank you for your help on this.  I discovered (with the help of my friends at Falafel Software...thanks Basem!) that the problem I was experiencing is a bug with Sitefinity 4.0.  Apparently, AJAX is broken with the RadGrid in Sitefinity 4.0.  Hoping for a fix today with the release of Sitefinity 4.1....right Telerik?

    Thanks for trying,
    Jim
  5. Georgi
    Admin
    Georgi avatar
    31 posts

    Posted 18 Apr 2011 Link to this post

    Hello Jim,

    Right. This is going to be fixed with the 4.1 release.

    Greetings,
    Georgi
    the Telerik team

Back to Top