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

RADGrid edit + update not working

6 Answers 221 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 2
Joe asked on 20 Dec 2010, 08:24 PM

I had this working, but someone I broke it. When I use the autogenerated update, cancel and delete links, they hang. The edit link opens the edit form with no issues.

This seems  to start when I tried to create the columns on my own. I wanted to change the link to a image button.

My code is below:

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
</telerik:RadAjaxLoadingPanel>
<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="QUARK_PEERING" GridLines="None"
    ShowStatusBar="True" AllowPaging="True" Skin="Web20" Width="920px"  OnItemUpdated="RadGrid1_ItemUpdated"
    OnItemDeleted="RadGrid1_ItemDeleted" OnItemInserted="RadGrid1_ItemInserted" OnDataBound="RadGrid1_DataBound"
    AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True" AutoGenerateHierarchy="True" AllowAutomaticDeletes="True"
    AllowAutomaticInserts="True" AllowAutomaticUpdates="True">
    <PagerStyle Mode="NextPrevNumericAndAdvanced"></PagerStyle>
    <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True">
        <Selecting AllowRowSelect="True" />
        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
    </ClientSettings>
    <AlternatingItemStyle BackColor="#DCE5BF" />
    <MasterTableView AutoGenerateColumns="false" DataSourceID="QUARK_PEERING" DataKeyNames="ASN"
        CommandItemDisplay="Top" Name="Peers" AllowFilteringByColumn="True">
        <CommandItemSettings ExportToPdfText="Export to Pdf" ShowExportToPdfButton="True"
            ShowAddNewRecordButton="True" ShowExportToCsvButton="True" ShowExportToExcelButton="True"
            ShowExportToWordButton="True"></CommandItemSettings>
        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
        </RowIndicatorColumn>
        <ExpandCollapseColumn Visible="True">
        </ExpandCollapseColumn>
        <DetailTables>
            <telerik:GridTableView runat="server" CommandItemDisplay="Top" DataSourceID="QUARK_PEERING2"
                AutoGenerateColumns="false" DataKeyNames="ID" Name="Peerings" AllowPaging="True"
                PageSize="3">
                <ParentTableRelation>
                    <telerik:GridRelationFields DetailKeyField="ASN" MasterKeyField="ASN" />
                </ParentTableRelation>
                <Columns>
                    <telerik:GridBoundColumn DataField="ASN" HeaderText="ASN" SortExpression="ASN" UniqueName="ASN"
                        HeaderStyle-Width="45px">
                        <HeaderStyle Width="45px"></HeaderStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridDropDownColumn DataField="EXCHANGE_ID" DataSourceID="QUARK_EXCHANGES"
                        HeaderText="Exchange" ListTextField="EXCHANGE_NAME" ListValueField="EXCHANGE_ID"
                        UniqueName="EXCHANGE_ID" ColumnEditorID="GridDropDownColumnEditor1">
                    </telerik:GridDropDownColumn>
                    <telerik:GridBoundColumn DataField="IPv4_IP_01" HeaderText="IPv4 Peer IP 1" SortExpression="IPv4_IP_01"
                        UniqueName="IPv4_IP_01" HeaderStyle-Width="100px">
                        <HeaderStyle Width="100px"></HeaderStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="IPv4_IP_02" HeaderText="IPv4 Peer IP 2" SortExpression="IPv4_IP_02"
                        UniqueName="IPv4_IP_02" HeaderStyle-Width="100px">
                        <HeaderStyle Width="100px"></HeaderStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="IPv6_IP_01" HeaderText="IPv6 Peer IP 1" SortExpression="IPv6_IP_01"
                        UniqueName="IPv6_IP_01" HeaderStyle-Width="150px">
                        <HeaderStyle Width="150px"></HeaderStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="IPv6_IP_02" HeaderText="IPv6 Peer IP 2" SortExpression="IPv6_IP_02"
                        UniqueName="IPv6_IP_02" HeaderStyle-Width="150px">
                        <HeaderStyle Width="150px"></HeaderStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="MAX_PREFIX" HeaderText="Maximum # of Prefixes"
                        SortExpression="MAX_PREFIX" UniqueName="MAX_PREFIX" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="CURRENT_PREFIX" HeaderText="Current # of Prefixes"
                        SortExpression="CURRENT_PREFIX" UniqueName="CURRENT_PREFIX" HeaderStyle-Width="75px">
                        <HeaderStyle Width="75px"></HeaderStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="MD5_PASSWORD" HeaderText="Peering Password" SortExpression="MD5_PASSWORD"
                        UniqueName="MD5_PASSWORD" Visible="False">
                    </telerik:GridBoundColumn>
                </Columns>
                <CommandItemSettings ShowAddNewRecordButton="True"></CommandItemSettings>
                <RowIndicatorColumn>
                    <HeaderStyle Width="20px" />
                </RowIndicatorColumn>
                <ExpandCollapseColumn>
                    <HeaderStyle Width="20px" />
                </ExpandCollapseColumn>
                <EditFormSettings>
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                    </EditColumn>
                </EditFormSettings>
            </telerik:GridTableView>
        </DetailTables>
        <Columns>
            <telerik:GridBoundColumn DataField="COMPANY_NAME" HeaderText="Network Name" SortExpression="COMPANY_NAME"
                UniqueName="COMPANY_NAME">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="ASN" HeaderText="ASN" SortExpression="ASN" UniqueName="ASN">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="PRIMARY_CONTACT" HeaderText="Primary Contact"
                SortExpression="PRIMARY_CONTACT" UniqueName="PRIMARY_CONTACT" Visible="False">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="PRIMARY_EMAIL" HeaderText="Primary Email" SortExpression="PRIMARY_EMAIL"
                UniqueName="PRIMARY_EMAIL" Visible="False">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="PRIMARY_NUMBER" HeaderText="Primary Email" SortExpression="PRIMARY_NUMBER"
                UniqueName="PRIMARY_NUMBER" Visible="False">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="SUPPORT_CONTACT" HeaderText="Support Contact"
                SortExpression="SUPPORT_CONTACT" UniqueName="SUPPORT_CONTACT" Visible="False">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="SUPPORT_EMAIL" HeaderText="Support Email" SortExpression="SUPPORT_EMAIL"
                UniqueName="SUPPORT_EMAIL" Visible="False">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="SUPPORT_NUMBER" HeaderText="Support Number" SortExpression="SUPPORT_NUMBER"
                UniqueName="SUPPORT_NUMBER" Visible="False">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="PEERING_CONTACT" HeaderText="Peering Contact"
                SortExpression="PEERING_CONTACT" UniqueName="PEERING_CONTACT" Visible="False">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="PEERING_EMAIL" HeaderText="Peering Email" SortExpression="PEERING_EMAIL"
                UniqueName="PEERING_EMAIL" Visible="False">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="PEERING_NUMBER" HeaderText="Peering Number" SortExpression="PEERING_NUMBER"
                UniqueName="PEERING_NUMBER" Visible="False">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="PEERING_DB_LINK" HeaderText="PeeringDB Link"
                SortExpression="PEERING_DB_LINK" UniqueName="PEERING_DB_LINK" Visible="false">
            </telerik:GridBoundColumn>
        </Columns>
        <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
            </EditColumn>
        </EditFormSettings>
    </MasterTableView>
    <PagerStyle Mode="NextPrevNumericAndAdvanced" />
    <FilterMenu EnableImageSprites="False">
    </FilterMenu>
    <HeaderContextMenu>
        <ExpandAnimation Type="OutBounce" />
    </HeaderContextMenu>
</telerik:RadGrid>
<telerik:GridDropDownListColumnEditor ID="GridDropDownColumnEditor1" runat="server"
    DropDownStyle-Width="110px" />

6 Answers, 1 is accepted

Sort by
0
Joe
Top achievements
Rank 2
answered on 21 Dec 2010, 03:41 AM
After disabling ajaxmanager, I'm now recieving this error:

Specified argument was out of the range of valid values.
Parameter name: ItemHierarchicalIndex

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: ItemHierarchicalIndex

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: ItemHierarchicalIndex]
   Telerik.Web.UI.GridItemCollection.get_Item(String hierarchicalIndex) +63
   Telerik.Web.UI.GridTableView.ClearEditItemsAfterPageSizeChanged(Int32 newPageSize) +195
   Telerik.Web.UI.GridTableView.set_PageSize(Int32 value) +263
   Telerik.Web.UI.GridTableView.CloneThis() +686
   Telerik.Web.UI.GridTableView.Clone() +5
   Telerik.Web.UI.GridItemBuilder.CreateDetailTable(GridDataItem parentItem, GridNestedViewItem detailItem, Int32 detailCounter, GridTableView detailTable) +28
   Telerik.Web.UI.GridItemBuilder.BindDetailTables(GridDataItem parentItem, GridNestedViewItem detailItem) +165
   Telerik.Web.UI.GridItemBuilder.CreateItems(GridGroupingContext group) +1120
   Telerik.Web.UI.GridTableView.CreateItems(IEnumerator enumerator, GridColumn[] columns, ControlCollection controls) +128
   Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) +919
   Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +659
   System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +66
   System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +128
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +33
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +143
   Telerik.Web.UI.GridTableView.PerformSelect() +16
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74
   Telerik.Web.UI.GridTableView.DataBind() +256
   Telerik.Web.UI.GridTableView.Rebind() +49
   Telerik.Web.UI.GridCommandEventArgs.ExecuteCommand(Object source) +170
   Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e) +137
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +87
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +125
   System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +169
   System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +9
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +176
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563
0
Tsvetoslav
Telerik team
answered on 23 Dec 2010, 11:41 AM
Hello Joe,

Try upgrading to the latest internal build - there was an issuw with service pack 1 that should have been fixed.

Regards,
Tsvetoslav
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
K
Top achievements
Rank 1
answered on 12 Jan 2011, 04:44 PM
Hello,

I'm having a similar problem with version 2010.3.1215.35.   The Exception is the same but it occurs when the Edit link is clicked.

If I do either of the following, I can make the problem go away.

1. Set the pagesize in both the master and detail tables to the same size
2. Cancel the PageSizeChanged event by using e.canceled = true in the code behind.

I used the following code to reproduce (no code behind)

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="test.aspx.vb" Inherits="test" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="ClientAdminScriptManager" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadGrid ID="RG_CurrentConfiguration" runat="server" DataSourceID="SqlDataSource1" AllowPaging="True"  AutoGenerateEditColumn="True" Width="80%" GridLines="None">
        <PagerStyle Position="Top" />
        <MasterTableView DataKeyNames="CustomerID" PageSize="5">
            <DetailTables>
                <telerik:GridTableView DataKeyNames="CustomerID" DataSourceID="SqlDataSource2" PageSize="100" AutoGenerateColumns="true">
                    <ParentTableRelation>
                        <telerik:GridRelationFields DetailKeyField="CustomerID" MasterKeyField="CustomerID" />
                    </ParentTableRelation>
                </telerik:GridTableView>
            </DetailTables>
            <CommandItemSettings />
            <ExpandCollapseColumn ButtonType="PushButton">
            </ExpandCollapseColumn>
        </MasterTableView>
    </telerik:RadGrid>
  <asp:SqlDataSource ID="SqlDataSource2" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
        SelectCommand="SELECT [CustomerID],[ContactName],[ContactTitle], [Address],[City],[PostalCode],[Country],[Phone],[Fax] FROM [Customers] where CustomerID=@CustomerID"
        runat="server">
        <SelectParameters>
            <asp:Parameter Name="CustomerID" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
        SelectCommand="SELECT [CustomerID], [CompanyName], [ContactName], [ContactTitle] FROM [Customers]"
        runat="server"></asp:SqlDataSource>
    </form>
</body>
</html>
0
Tsvetoslav
Telerik team
answered on 13 Jan 2011, 10:22 AM
Hello Joe,

Along with the improvements our development team introduced some issues into the service pack that you are using. Please, upgrade to the latest internal build, those should have been fixed there. 

Regards,
Tsvetoslav
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
chrisL
Top achievements
Rank 1
answered on 04 Feb 2011, 04:18 AM
I'm getting this same problem but I am working with DotNetNuke 5.6.1. Is it okay for me to just upgrade the telerik dll in the bin folder (which is currently version 2010.2.929.35) to the latest version?

Thanks
Chris
0
Tsvetoslav
Telerik team
answered on 08 Feb 2011, 03:51 PM
Hi K,

There should be no problem with that.

Regards,
Tsvetoslav
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Grid
Asked by
Joe
Top achievements
Rank 2
Answers by
Joe
Top achievements
Rank 2
Tsvetoslav
Telerik team
K
Top achievements
Rank 1
chrisL
Top achievements
Rank 1
Share this question
or