This is a migrated thread and some comments may be shown as answers.

Grid Update Not Working

3 Answers 147 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jim
Top achievements
Rank 2
Jim asked on 11 Apr 2011, 10:20 PM
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

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 12 Apr 2011, 08:49 AM
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.
0
Jim
Top achievements
Rank 2
answered on 13 Apr 2011, 11:03 AM
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
0
Georgi
Telerik team
answered on 18 Apr 2011, 12:44 PM
Hello Jim,

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

Greetings,
Georgi
the Telerik team

Tags
Grid
Asked by
Jim
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Jim
Top achievements
Rank 2
Georgi
Telerik team
Share this question
or