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

Parent node closes unexpectedly

9 Answers 69 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 2
Joe asked on 18 Aug 2008, 09:33 PM
Hi,

I'm having a problem with the RadGrid when using a multi-level hierarchy. Level 1 of the hierarchy is load mode client. Level 2 is load mode client. Level 3 is load mode server-on-demand. Here are the steps I'm following to reproduce the problem:

  • Open the window, all nodes are closed.
  • Open one of the level 1 nodes - the node expands as expected.
  • Open one of the level 2 nodes - the node expands as expected.
  • Open one of the level 3 nodes - the level 1 node collapses unexpectedly.
  • Reopen the level 1 node and observe that the level 3 node is expanded, as originally expected.

I'm currently using Prometheus 2007.3. I was able to reproduce the problem using ASP.NET AJAX 2008.1 as well.

Needless to say the users find it disconcerting, as they have to search through the level 1 nodes to find the one they were originally looking at.

The problem does not occur if I set all levels to load mode client.

9 Answers, 1 is accepted

Sort by
0
Joe
Top achievements
Rank 2
answered on 19 Aug 2008, 02:55 PM

I also verified it's happening under 2008.2. Here is a sample that demonstrates the problem. Steps to reproduce:

  • Open the first node, id = 1. You will observe that there are two tables under this node. The top table is server on demand load, the bottom is client load.
  • Expand id 2 in the bottom table. The table expands as expected.
  • Attempt to expand id 2 in the top table. Observe that the instead of the id 2 node expanding, the id 1 node collapses.

As I mentioned in my original email, the problem also occurs if the server on demand node is located at the next level below the 2 parent client load nodes.

-- ASPX

 

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

 

<%@ Register Assembly="Telerik.Web.UI, Version=2008.1.415.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4"

    Namespace="Telerik.Web.UI" TagPrefix="radG" %>

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

    <title>Untitled Page</title>

</head>

<body>

    <form id="form1" runat="server">

        <radG:RadScriptManager ID="RadScriptManager1" runat="server">

        </radG:RadScriptManager>

        <div>

            <asp:Label ID="Label1" runat="server" Text="Features:"></asp:Label>

            <ul>

                <li>Client loading of first hierarchy, server loading of second hierarchy</li>

                <li>ObjectDataSources using DataTables</li>

            </ul>

            <radG:RadGrid runat="server" ID="radGrid" AllowPaging="True" AutoGenerateColumns="False"

                DataSourceID="MasterObjectDataSource" GridLines="None">

                <MasterTableView DataSourceID="MasterObjectDataSource" DataKeyNames="id"

                    HierarchyLoadMode="Client">

                    <Columns>

                        <radG:GridBoundColumn DataField="Id" DataType="System.Int32" HeaderText="Id" ReadOnly="True"

                            SortExpression="Id" UniqueName="Id">

                        </radG:GridBoundColumn>

                        <radG:GridBoundColumn DataField="Data" HeaderText="Data" ReadOnly="True" SortExpression="Data"

                            UniqueName="Data">

                        </radG:GridBoundColumn>

                    </Columns>

                    <DetailTables>

                        <radG:GridTableView DataSourceID="DetailsObjectDataSource" DataKeyNames="id" AutoGenerateColumns="True" runat="server"

                            HierarchyLoadMode="ServerOnDemand">

                            <ParentTableRelation>

                                <radG:GridRelationFields DetailKeyField="masterId" MasterKeyField="id" />

                            </ParentTableRelation>

                            <DetailTables>

                                <radG:GridTableView DataSourceID="SubDetailsObjectDataSource" DataKeyNames="id" AutoGenerateColumns="True" runat="server"

                                    AllowPaging="false">

                                    <ParentTableRelation>

                                        <radG:GridRelationFields DetailKeyField="detailsId" MasterKeyField="id" />

                                    </ParentTableRelation>

                                    <RowIndicatorColumn Visible="False">

                                        <HeaderStyle Width="20px" />

                                    </RowIndicatorColumn>

                                    <ExpandCollapseColumn Resizable="False" Visible="False">

                                        <HeaderStyle Width="20px" />

                                    </ExpandCollapseColumn>

                                    <EditFormSettings>

                                        <PopUpSettings ScrollBars="None" />

                                    </EditFormSettings>

                                </radG:GridTableView>

                            </DetailTables>

                            <RowIndicatorColumn Visible="False">

                                <HeaderStyle Width="20px" />

                            </RowIndicatorColumn>

                            <ExpandCollapseColumn Resizable="False">

                                <HeaderStyle Width="20px" />

                            </ExpandCollapseColumn>

                            <EditFormSettings>

                                <PopUpSettings ScrollBars="None" />

                            </EditFormSettings>

                        </radG:GridTableView>

                        <radG:GridTableView DataSourceID="DetailsObjectDataSource" DataKeyNames="id" AutoGenerateColumns="True" runat="server"

                            HierarchyLoadMode="Client">

                            <ParentTableRelation>

                                <radG:GridRelationFields DetailKeyField="masterId" MasterKeyField="id" />

                            </ParentTableRelation>

                            <DetailTables>

                                <radG:GridTableView DataSourceID="SubDetailsObjectDataSource" DataKeyNames="id" AutoGenerateColumns="True" runat="server"

                                    AllowPaging="false">

                                    <ParentTableRelation>

                                        <radG:GridRelationFields DetailKeyField="detailsId" MasterKeyField="id" />

                                    </ParentTableRelation>

                                    <RowIndicatorColumn Visible="False">

                                        <HeaderStyle Width="20px" />

                                    </RowIndicatorColumn>

                                    <ExpandCollapseColumn Resizable="False" Visible="False">

                                        <HeaderStyle Width="20px" />

                                    </ExpandCollapseColumn>

                                    <EditFormSettings>

                                        <PopUpSettings ScrollBars="None" />

                                    </EditFormSettings>

                                </radG:GridTableView>

                            </DetailTables>

                            <RowIndicatorColumn Visible="False">

                                <HeaderStyle Width="20px" />

                            </RowIndicatorColumn>

                            <ExpandCollapseColumn Resizable="False">

                                <HeaderStyle Width="20px" />

                            </ExpandCollapseColumn>

                            <EditFormSettings>

                                <PopUpSettings ScrollBars="None" />

                            </EditFormSettings>

                        </radG:GridTableView>

                    </DetailTables>

                    <RowIndicatorColumn Visible="False">

                        <HeaderStyle Width="20px" />

                    </RowIndicatorColumn>

                    <ExpandCollapseColumn Resizable="False">

                        <HeaderStyle Width="20px" />

                    </ExpandCollapseColumn>

                    <EditFormSettings>

                        <PopUpSettings ScrollBars="None" />

                    </EditFormSettings>

                </MasterTableView>

                <PagerStyle Mode="NextPrevAndNumeric"/>

            </radG:RadGrid>

            <asp:ObjectDataSource ID="MasterObjectDataSource" runat="server" SelectMethod="GetMasterObjects"

                TypeName="DataGenerator2"></asp:ObjectDataSource>

            <asp:ObjectDataSource ID="DetailsObjectDataSource" runat="server" SelectMethod="GetDetailsObjectBy"

                TypeName="DataGenerator2">

                <SelectParameters>

                    <asp:Parameter Name="masterId" Type="Int32" />

                </SelectParameters>

            </asp:ObjectDataSource>

            <asp:ObjectDataSource ID="SubDetailsObjectDataSource" runat="server" SelectMethod="GetSubDetailsObjectBy"

                TypeName="DataGenerator2">

                <SelectParameters>

                    <asp:Parameter Name="detailsId" Type="Int32" />

                </SelectParameters>

            </asp:ObjectDataSource>

        </div>

    </form>

</body>

</html>

 

-- C#

 

using System.Collections.Generic;

using System.Data;

 

using MDS = MasterDataSet;

 

/// <summary>

/// Summary description for DataGenerator

/// </summary>

public static class DataGenerator2

{

    private static MDS _dataSet;

 

    static DataGenerator2()

    {

        GenerateData();

    }

 

    private static void GenerateData()

    {

        MDS ds = new MDS();

        int nextId = 0;

        for (int i = 0; i < 50; i++)

        {

            int masterId = ++nextId;

            ds.MasterDataTable.AddMasterDataTableRow(masterId, string.Format("masterObject_{0}", masterId));

            for (int j = 0; j < 5; j++)

            {

                int detailId = ++nextId;

                MDS.DetailDataTableRow detailRow = ds.DetailDataTable.NewDetailDataTableRow();

                detailRow.Id = detailId;

                detailRow.MasterId = masterId;

                detailRow.Data = string.Format("detailObject_{0}", detailId);

                ds.DetailDataTable.AddDetailDataTableRow(detailRow);

 

                for (int k = 0; k < 60; k++)

                {

                    int subDetailId = ++nextId;

                    MDS.DetailDataTableRow subDetailRow = ds.DetailDataTable.NewDetailDataTableRow();

                    subDetailRow.Id = subDetailId;

                    subDetailRow.MasterId = detailId;

                    subDetailRow.Data = string.Format("subDetailObject_{0}", subDetailId);

                    ds.DetailDataTable.AddDetailDataTableRow(subDetailRow);

                }

            }

        }

        _dataSet = ds;

    }

 

    public static MDS.MasterDataTableDataTable GetMasterObjects()

    {

        return _dataSet.MasterDataTable;

    }

 

    public static DataView GetDetailsObjectBy(int masterId)

    {

        return FilterDetails(masterId);

    }

 

    private static DataView FilterDetails(int masterId)

    {

        DataView dv = new DataView(_dataSet.DetailDataTable);

        dv.RowFilter = string.Format("MasterId = '{0}'", masterId);

        return dv;

    }

 

    public static DataView GetSubDetailsObjectBy(int detailsId)

    {

        return FilterDetails(detailsId);

    }

}

 

-- XSD

 

<?xml version="1.0" encoding="utf-8"?>

<xs:schema id="MasterDataSet" targetNamespace="http://tempuri.org/MasterDataSet.xsd" xmlns:mstns="http://tempuri.org/MasterDataSet.xsd" xmlns="http://tempuri.org/MasterDataSet.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">

  <xs:annotation>

    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">

      <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">

        <Connections>

        </Connections>

        <Tables>

        </Tables>

        <Sources>

        </Sources>

      </DataSource>

    </xs:appinfo>

  </xs:annotation>

  <xs:element name="MasterDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:Generator_UserDSName="MasterDataSet" msprop:Generator_DataSetName="MasterDataSet">

    <xs:complexType>

      <xs:choice minOccurs="0" maxOccurs="unbounded">

        <xs:element name="MasterDataTable" msprop:Generator_UserTableName="MasterDataTable" msprop:Generator_RowDeletedName="MasterDataTableRowDeleted" msprop:Generator_RowChangedName="MasterDataTableRowChanged" msprop:Generator_RowClassName="MasterDataTableRow" msprop:Generator_RowChangingName="MasterDataTableRowChanging" msprop:Generator_RowEvArgName="MasterDataTableRowChangeEvent" msprop:Generator_RowEvHandlerName="MasterDataTableRowChangeEventHandler" msprop:Generator_TableClassName="MasterDataTableDataTable" msprop:Generator_TableVarName="tableMasterDataTable" msprop:Generator_RowDeletingName="MasterDataTableRowDeleting" msprop:Generator_TablePropName="MasterDataTable">

          <xs:complexType>

            <xs:sequence>

              <xs:element name="Id" msprop:Generator_UserColumnName="Id" msprop:Generator_ColumnPropNameInRow="Id" msprop:Generator_ColumnVarNameInTable="columnId" msprop:Generator_ColumnPropNameInTable="IdColumn" type="xs:int" minOccurs="0" />

              <xs:element name="Data" msprop:Generator_UserColumnName="Data" msprop:Generator_ColumnPropNameInRow="Data" msprop:Generator_ColumnVarNameInTable="columnData" msprop:Generator_ColumnPropNameInTable="DataColumn" type="xs:string" minOccurs="0" />

            </xs:sequence>

          </xs:complexType>

        </xs:element>

        <xs:element name="DetailDataTable" msprop:Generator_UserTableName="DetailDataTable" msprop:Generator_RowDeletedName="DetailDataTableRowDeleted" msprop:Generator_RowChangedName="DetailDataTableRowChanged" msprop:Generator_RowClassName="DetailDataTableRow" msprop:Generator_RowChangingName="DetailDataTableRowChanging" msprop:Generator_RowEvArgName="DetailDataTableRowChangeEvent" msprop:Generator_RowEvHandlerName="DetailDataTableRowChangeEventHandler" msprop:Generator_TableClassName="DetailDataTableDataTable" msprop:Generator_TableVarName="tableDetailDataTable" msprop:Generator_RowDeletingName="DetailDataTableRowDeleting" msprop:Generator_TablePropName="DetailDataTable">

          <xs:complexType>

            <xs:sequence>

              <xs:element name="Id" msprop:Generator_UserColumnName="Id" msprop:Generator_ColumnPropNameInRow="Id" msprop:Generator_ColumnVarNameInTable="columnId" msprop:Generator_ColumnPropNameInTable="IdColumn" type="xs:int" minOccurs="0" />

              <xs:element name="MasterId" msprop:Generator_UserColumnName="MasterId" msprop:Generator_ColumnPropNameInRow="MasterId" msprop:Generator_ColumnVarNameInTable="columnMasterId" msprop:Generator_ColumnPropNameInTable="MasterIdColumn" type="xs:int" minOccurs="0" />

              <xs:element name="Data" msprop:Generator_UserColumnName="Data" msprop:Generator_ColumnPropNameInRow="Data" msprop:Generator_ColumnVarNameInTable="columnData" msprop:Generator_ColumnPropNameInTable="DataColumn" type="xs:string" minOccurs="0" />

            </xs:sequence>

          </xs:complexType>

        </xs:element>

      </xs:choice>

    </xs:complexType>

  </xs:element>

  <xs:annotation>

    <xs:appinfo>

      <msdata:Relationship name="MasterDataTable_DetailDataTable" msdata:parent="MasterDataTable" msdata:child="DetailDataTable" msdata:parentkey="Id" msdata:childkey="MasterId" msprop:Generator_UserRelationName="MasterDataTable_DetailDataTable" msprop:Generator_RelationVarName="relationMasterDataTable_DetailDataTable" msprop:Generator_UserChildTable="DetailDataTable" msprop:Generator_UserParentTable="MasterDataTable" msprop:Generator_ParentPropName="MasterDataTableRow" msprop:Generator_ChildPropName="GetDetailDataTableRows" />

      <msdata:Relationship name="DetailDataTable_DetailDataTable" msdata:parent="DetailDataTable" msdata:child="DetailDataTable" msdata:parentkey="MasterId" msdata:childkey="Id" msprop:Generator_UserRelationName="DetailDataTable_DetailDataTable" msprop:Generator_RelationVarName="relationDetailDataTable_DetailDataTable" msprop:Generator_UserChildTable="DetailDataTable" msprop:Generator_UserParentTable="DetailDataTable" msprop:Generator_ParentPropName="DetailDataTableRowParent" msprop:Generator_ChildPropName="GetDetailDataTableRows" />

    </xs:appinfo>

  </xs:annotation>

</xs:schema>

0
Joe
Top achievements
Rank 2
answered on 20 Aug 2008, 02:24 PM
Anybody home??
0
Joe
Top achievements
Rank 2
answered on 21 Aug 2008, 03:45 PM
Anybody home yet??
0
Leon
Top achievements
Rank 1
answered on 21 Aug 2008, 07:03 PM
Joe,

I'm at home! ;)

Do you get the problem using client mode along with the ServerBind? I remember I've seen a demo on the site demonstrating Mixed load mode:

http://www.telerik.com/demos/aspnet/prometheus/Grid/Examples/Hierarchy/HierarchyLoadModeMixed/DefaultCS.aspx

Hopefully this would be an acceptable work around for you.

~Leon
0
Joe
Top achievements
Rank 2
answered on 21 Aug 2008, 08:20 PM
Hi Leon,

Yes, I've already got the mixed mode binding working using that example. Actually, the example I posted is derived from that.

I guess I'll just have to submit a ticket. I was trying to avoid that as it's easier for me to resolve problems in the forum, if possible.

Thanks, Joe
0
Leon
Top achievements
Rank 1
answered on 21 Aug 2008, 08:25 PM
Well, getting the solution in the forums is sometimes faster as I've seen some very active community members around, but using the support tickets you can send the exact runnable demo which replicates the problem. Make sure you submit the ticket with a demo including the necessary resources (I often use dummy data for the Grid since the problems are not related to exact data) getting faster resolution this way since they can debug my code. ;)

Good luck!
~Leon
0
Dimo
Telerik team
answered on 22 Aug 2008, 08:34 AM
Hi Joe,

The problem you are talking about is fixed now and changes will take effect in the coming Q2 2008 Service Pack 1.

Best wishes,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Joe
Top achievements
Rank 2
answered on 02 Sep 2008, 07:01 PM
FYI - After further testing it seems that the bug occurs in the 2008.2.723.35 version but not in the 2008.2.826.20 version.
0
Joe
Top achievements
Rank 2
answered on 09 Sep 2008, 02:46 PM
FYI - It's also fixed in the 2008.2.826.35 version.
Tags
Grid
Asked by
Joe
Top achievements
Rank 2
Answers by
Joe
Top achievements
Rank 2
Leon
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or