Breaking Change for RadTreeList in 2014.1.403.40?

11 posts, 0 answers
  1. Dave
    Dave avatar
    12 posts
    Member since:
    Jun 2012

    Posted 07 May 2014 Link to this post

    I upgraded from 2013.3.1324.40 to 2014.1.403.40 and when I perform DataBind() on my RadTreeList it fails with:

    An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll

    I switch back to the old version and it works fine.

    Was there a breaking change for 2014.1.403.40?  

    Thanks,

    Dave


  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 08 May 2014 in reply to Dave Link to this post

    Hi Dave,

    The provided information is not enough to replicate the issue. Please have a look into the sample code snippet which works fine at my end in Telerik Version 2014.1.403.40. Somewhere in your code, any recursive loop or something like that is happening. So that the code will run and run until there is no more stack space available. Because of that this System.StackOverflowexception is happening. Please provide your full code if it doesn't help.

    ASPX:

    <telerik:RadTreeList runat="server" ID="RadTreeList1" AllowPaging="true" PageSize="3" DataKeyNames="EmployeeID" OnItemCommand="RadTreeList1_ItemCommand" OnPageIndexChanged="RadTreeList1_PageIndexChanged" ParentDataKeyNames="ReportsTo">
    </telerik:RadTreeList>

    C#:
    public DataTable GetDataTable()
    {
        String ConnString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
        SqlConnection conn = new SqlConnection(ConnString);
        SqlDataAdapter adapter = new SqlDataAdapter();
        adapter.SelectCommand = new SqlCommand("SELECT EmployeeID, LastName, FirstName, Title, TitleOfCourtesy, ReportsTo FROM Employees", conn);
        DataTable myDataTable = new DataTable();
        conn.Open();
        try
        {
            adapter.Fill(myDataTable);
        }
        finally
        {
            conn.Close();
        }
        return myDataTable;
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            RadTreeList1.DataSource = GetDataTable();
            RadTreeList1.DataBind();
        }
    }
    protected void RadTreeList1_ItemCommand(object sender, TreeListCommandEventArgs e)
    {
        if (e.CommandName == RadTreeList.ExpandCollapseCommandName)
        {
            RadTreeList1.DataSource = GetDataTable();
            RadTreeList1.DataBind();
        }
    }
    protected void RadTreeList1_PageIndexChanged(object source, TreeListPageChangedEventArgs e)
    {
        RadTreeList1.CurrentPageIndex = e.NewPageIndex;
        RadTreeList1.DataSource = GetDataTable();
        RadTreeList1.DataBind();
    }

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. jose antonio
    jose antonio avatar
    12 posts
    Member since:
    Apr 2009

    Posted 08 May 2014 in reply to Princy Link to this post

    Hello All,

    Princy is right in the fact that he didnt provide data to replicate this issue, but also wrong, because thats just the same code as in any example and I think its not respectful (as software developers)

    Im just having the same problem as Dave and I bet that he has multiple keynames and not just one.

    This is my (probably our) scenario:

    Table 1:  ID
    Table 2: ID_Table1, ID_Table2

    In this way i had to fake the Id parent for table one and set it to null in an union select.

    This way i had a data set of two tables,looking like this
    DataKeys = ID_TABLE1
    Parent keys = ID_PARENT

    ID_TABLE1     ID_TABLE2    ID_PARENT
    1                       NULL            NULL
    2                       NULL            NULL
    1                       0                   1
    1                       1                   1
    2                       0                   2


    These used to work. But not anymore. I Tried to fix it using two primarykeys for datakey and parentID but it didnt work When IT SHOULD WORK like this:

    DataKeyName = IdTable1, IDtable2
    ParentKey       = ParentIdtable1, ParentIdtable2

    But it doesnt.

    If anyone has a working demo for this id be nice.

    My software is on production and i want to publish new features with the latest versions of my libraries including telerik's and if this lastest version breaks it, then whats the point?

    Thanks,
  5. Dave
    Dave avatar
    12 posts
    Member since:
    Jun 2012

    Posted 08 May 2014 in reply to Princy Link to this post

    Thanks for responding.  However, I cannot simply post my code,  you must understand that I am not doing this for fun, but professionally, and posting my FULL code would be inappropriate and have legal consequences.

    Keep in mind also, that it is an extensive application, not a couple of pages, so even if I did provide it, it would be meaningless to you, unless you have the web services, databases, and the rest of the application, and so on to make it function.

    I can tell you, that this has been working, without problem, for over a year, having multiple Telerik updates, and that simply swapping the the version I indicated with the latest breaks it, with absolutely nothing else changing, with live production code.

    The jest of the code is the following, with names changed:

    Databinding used is a list of custom objects, e.g. List<MyClass> myObjects;

                        RadTreeListABC.DataKeyNames = new string[] { "MyPKID" };
                        RadTreeListABC.ParentDataKeyNames = new string[] { "MyParentID" };
                        RadTreeListABC.DataSource = myObjects;
                        RadTreeListABC.AutoGenerateColumns = false;
                        RadTreeListABC.ShowTreeLines = true;
                        RadTreeListABC.HideExpandCollapseButtonIfNoChildren = false;
                        RadTreeListABC.DataBind();

    Not sure if this helps or not.

    P.S. the formatting on posting in the forum is terrible.  You get to a point where it doesn't have any more lines and you can't see what you are typing, hitting enter a bunch of times eventually puts you at the bottom.  Chrome 34.0.1847.131 m Windows 7.

    Thanks,
    Dave








     























  6. Kostadin
    Admin
    Kostadin avatar
    1713 posts

    Posted 12 May 2014 Link to this post

    Hi Jose,

    I tried the scenario which you described and with the latest version the server crashed. In this scenario you have a relation where the child and the parent item have an identical ID. In this case the logic which display the items gets in an infinite loop and System.StackOverflowException occurs or the server crashed. Keep in mind that this is an invalid scenario and the DataKeyNames filed should be a filed with unique ids. Nevertheless I logged this issue as a bug in our system and our developers will look at it and fixed it in our next official release. You could track the progress in our Ideas&Feedback portal.

    Hi Dave,

    I assume that your DataKeyName filed have also repeated ids and this is causing the exception.

    Regards,
    Kostadin
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  7. Dave
    Dave avatar
    12 posts
    Member since:
    Jun 2012

    Posted 12 May 2014 in reply to Kostadin Link to this post

    I do not have any records where the ParentKey = the Child key....I didn't provide data so I'm not sure how you came to that conclusion.

    I do have cases where the ParentId is NULL, meaning it has no parent / is the top level, but I've confirmed that there are no records where ParentId = MainId

    As I mentioned, this has been working for over a year--some implementation has changed with this release.

    As it stands, it looks like I will not be able to use updates for this product until it is fixed.  The issue is different than what you have concluded, so I think some additional investigation will be needed.

    Thanks,

    Dave
  8. Kostadin
    Admin
    Kostadin avatar
    1713 posts

    Posted 15 May 2014 Link to this post

    Hello Dave,

    I was able to replicate the issue which you are talking about when you have the repeating IDs in a field set as a DataKeyName. For instance, if your data field has a values - 1,1,2,2,2,3,3,4,5,6,7. and you set this field as a DataKeyName, you will receive a System.StackOverflowException' due to an infinite loop. If you does not  have such repeating values in your data field, could you please provide a small runnable sample with a dummy database in order to investigate the cause for this issue?

    Regards,
    Kostadin
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  9. Dave
    Dave avatar
    12 posts
    Member since:
    Jun 2012

    Posted 15 May 2014 in reply to Dave Link to this post

    I started to put together an example application and as part of that I was stepping through my code looking at the parent and key values.

    To my surprise the values are not what I expected.  E.g.

    Parent     Child
    NULL        1
    1                2
    1                2
    1                2
    1                2


    This is not what it should be--it isn't causing an issues because I'm only using the child keys for the Tree itself, but it should be a fabricated ID that is being kept track of.
     
    So, based on what you are describing, it sounds like this is not supported as of this version.  I will update my application in my  next release to use proper keys.   It definitely broke with the latest release, although my instance was not intentional, so not a big complain from me.
     
    Thanks for checking into this.
     
    Dave 
  10. Kostadin
    Admin
    Kostadin avatar
    1713 posts

    Posted 20 May 2014 Link to this post

    Hi Dave,

    The issue is already fixed and it will be available in our next official release. Please excuse us for any inconvenience this might have caused you.

    Regards,
    Kostadin
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  11. Ludek
    Ludek avatar
    3 posts
    Member since:
    Jul 2008

    Posted 02 Jun 2014 in reply to Kostadin Link to this post

    Hi,
    when do you plan to release the new official version? Can you prepare the change for us in Latest internal build?

    Thanks
    Ludek
  12. Kostadin
    Admin
    Kostadin avatar
    1713 posts

    Posted 05 Jun 2014 Link to this post

    Hello Ludek,

    The fix is already included in the latest internal build, so you could downloaded and test it. As for the official release it is scheduled for end of the month.

    Regards,
    Kostadin
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017