Q3 RadGrid Crashes with mutiple GroupByFields

16 posts, 0 answers
  1. Alanm
    Alanm avatar
    18 posts
    Member since:
    Mar 2007

    Posted 18 Nov 2011 Link to this post

    I've just upgraded to 2011.3.1115.35 and my RadGrid now crashes.

    Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index 
       
       System.Collections.CollectionBase.System.Collections.IList.get_Item(Int32 index) +7602287
       Telerik.Web.UI.GridGroupByExpressionCollection.get_Item(Int32 index) +48

    I've tracked this to having multiple <GroupByFields> defined in the aspx. Delete either of the <GroupByFields> children and it works fine.  I did not have this problem in Q1 2011

    <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false">
        <MasterTableView>
            <GroupByExpressions>
                <telerik:GridGroupByExpression>
                    <SelectFields>
                        <telerik:GridGroupByField FieldName="Group1" ></telerik:GridGroupByField>
                        <telerik:GridGroupByField FieldName="Group2" ></telerik:GridGroupByField>
                    </SelectFields>
                    <GroupByFields>
                        <telerik:GridGroupByField FieldName="Group1" SortOrder="Descending"></telerik:GridGroupByField>
                        <telerik:GridGroupByField FieldName="Group2" SortOrder="Descending"></telerik:GridGroupByField>
                    </GroupByFields>
                </telerik:GridGroupByExpression>
            </GroupByExpressions>
            <Columns>
                <telerik:GridBoundColumn DataField="Group1" HeaderText="1" ></telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Group2" HeaderText="2" ></telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>

    For completeness here is the VB for the page

    Partial Class TestArea_Test
        Inherits System.Web.UI.Page
      
        Protected Sub RadGrid1_NeedDataSource(sender As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
            Dim result As New List(Of Test)
            result.Add(New Test("first", "second"))
            RadGrid1.DataSource = result
        End Sub
      
        Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
            RadGrid1.Rebind()
        End Sub
    End Class
      
    Class Test
        Private _Group1 As String
        Private _Group2 As String
      
        Public Sub New(ByVal g1 As String, ByVal g2 As String)
            Group1 = g1
            Group2 = g2
        End Sub
        Public Property Group1 As String
            Get
                Return _Group1
            End Get
            Set(value As String)
                _Group1 = value
            End Set
        End Property
        Public Property Group2 As String
            Get
                Return _Group2
            End Get
            Set(value As String)
                _Group2 = value
            End Set
        End Property
    End Class

  2. Chris Trina
    Chris Trina avatar
    86 posts
    Member since:
    Mar 2006

    Posted 19 Nov 2011 Link to this post

    I am having the exact same problem, single group bys work fine, but multiple cause the index issue.  This worked fine with the previous release.  Please include me on any solution.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. SWAT
    SWAT avatar
    12 posts
    Member since:
    Dec 2008

    Posted 19 Nov 2011 Link to this post

    Hi, allow me to pin-point the problem a little.
    The issue is related to the default EnableLinqExpressions="true" property of the RadGrid. if you set it to flase - it works.

    In the past version i saw that when i had problem with this property, i could solve it by "fixing" some of the other attributes of the grid columns or the database datatypes. I'm sure that somthing can be done here as well to the GridGroupByField but i don't know what at the momemnt. 
    I hope Telerik support can tell us.

    Thanks,
    ilan.
  5. Todd A
    Todd A avatar
    43 posts
    Member since:
    Sep 2009

    Posted 19 Nov 2011 Link to this post

    I had the same issue and setting EnableLinqexpressions="false" worked great.  Thanks SWAT for the tip!
  6. Chris Trina
    Chris Trina avatar
    86 posts
    Member since:
    Mar 2006

    Posted 19 Nov 2011 Link to this post

    Thanks swat, setting enablelinqexpressions=false took care of my issue also.  I appreciate your tip!
  7. Nicolaï
    Nicolaï avatar
    160 posts
    Member since:
    Apr 2008

    Posted 29 Nov 2011 Link to this post

    Yes! Thank you Swat! Life saver.
    Q3 2011 is making me go balder. Telerik owes me hair implants!
  8. Radoslav
    Admin
    Radoslav avatar
    1564 posts

    Posted 30 Nov 2011 Link to this post

    Hello all,

    Indeed I verified that the described issue exists in our latest version of the controls. It seems that the problem is related with the new grouping mechanism introduced with the latest version of the controls. To avoid the exception you could set the RadGrid.MasterTableView.EnableLinqGrouping property to "false".
    In Q3 2011 release we have a new Linq based grouping which is turned on by default. This type of grouping has a huge performance optimization and internally uses Dynamic Linq for grouping. Also this grouping is controlled by the MasterTableView.EnableLinqGrouping property(default value is "true"). More information you could find here:
    http://blogs.telerik.com/aspnet-ajax/posts/11-11-08/super-charged-performance-optimizations-for-telerik-s-asp-net-ajax-grid-in-q3-2011.aspx

    However  our developers fixed the described issue. On the following links you could find instructions how to use the hotfix dlls or how to upgrade Telerik's RadControls to another version:
    http://www.telerik.com/help/aspnet-ajax/introduction-using-hotfix.html
    http://www.telerik.com/support/kb/aspnet-ajax/general/updating-radcontrols-for-asp-net-to-another-version-or-license.aspx

    All the best,
    Radoslav
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  9. John Chatt
    John Chatt avatar
    24 posts
    Member since:
    Feb 2010

    Posted 29 Feb 2012 Link to this post

    This is still an issue as of the 2012 Q1 release. I still need to put EnableLinqExpression="False" on the radgrid in order for it to work.
    Will this ever be resolved or moving forward will it require this property being set to false?
  10. David Mullings
    David Mullings avatar
    7 posts
    Member since:
    Sep 2008

    Posted 01 Mar 2012 Link to this post

    Just to echo, this has not been fixed in the latest release. I still have to set the EnableLinqGrouping to false for my site to work correctly.
  11. Radoslav
    Admin
    Radoslav avatar
    1564 posts

    Posted 05 Mar 2012 Link to this post

    Hello,

    I tried to reproduce the described issue with the latest version of our controls but to no avail. I am sending you a simple example please check it out and let me know what differs in your case.

    Greetings,
    Radoslav
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  12. SWAT
    SWAT avatar
    12 posts
    Member since:
    Dec 2008

    Posted 07 Dec 2012 Link to this post

    Hi,
    just to let you know that i've update my Q3 2012 to the SP1 and the issue returned today as you can see here:
    http://screencast.com/t/oM4S8OHDH

    Thanks,
    ilan.
  13. Radoslav
    Admin
    Radoslav avatar
    1564 posts

    Posted 12 Dec 2012 Link to this post

    Hi Ilan,

    I tried to reproduce the described issue but to no avail. Could you please post your aspx page markup with the related code behind or send us a small runnable example where the problem could be reproduced. Thus we will be able to get more information about your scenario and provide you more to the point answer.

    Looking forward for your reply.

    Kind regards,
    Radoslav
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  14. SWAT
    SWAT avatar
    12 posts
    Member since:
    Dec 2008

    Posted 12 Dec 2012 Link to this post

    That is good, because it means i'm the only one that reported the bug, which gives me many points! ;)
    i tried to upload the sample page as RAR file, but this forum does not allow me! you need to fix this.
    see it in this video:http://screencast.com/t/Ne1Ox0wh3
    and here is the code:
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="GridGroupingTitle.aspx.cs" Inherits="TESTS_telerik_Default" Culture="en-US" %>
     
    <!DOCTYPE html>
     
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
            <telerik:RadScriptManager runat="server" ID="RadScriptManager1" EnableScriptCombine="false" EnablePageMethods="true" ScriptMode="Release" AsyncPostBackTimeout="500" />
            <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false">
                <MasterTableView >
                    <GroupByExpressions>
                        <telerik:GridGroupByExpression>
                            <SelectFields>
                                <telerik:GridGroupByField FieldAlias="Schedules" FieldName="Group1" FormatString="<b><font color='#c60c46'>{0:D}</font></b>" HeaderValueSeparator=" for "></telerik:GridGroupByField>
                                <telerik:GridGroupByField FieldAlias="Total" FieldName="Group1" Aggregate="Count" FormatString="<b>{0}</b>" HeaderValueSeparator=" of "></telerik:GridGroupByField>
                            </SelectFields>
                            <GroupByFields>
                                <telerik:GridGroupByField FieldName="Group1"></telerik:GridGroupByField>
                            </GroupByFields>
                        </telerik:GridGroupByExpression>
                    </GroupByExpressions>
                    <Columns>
                        <telerik:GridBoundColumn DataField="Group1" HeaderText="1"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Group2" HeaderText="2"></telerik:GridBoundColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>
        </form>
    </body>
    </html>

    code behind:
    using System;
    using System.Collections.Generic;
    using System.Linq;
     
    public partial class TESTS_telerik_Default : System.Web.UI.Page
    {
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
     
            RadGrid1.NeedDataSource += new Telerik.Web.UI.GridNeedDataSourceEventHandler(RadGrid1_NeedDataSource);
        }
     
        void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            List<Test> tests = new List<Test>() {
                new Test() { Group1 = DateTime.Now.AddDays(1).Date, Group2="Group10"},
                new Test() { Group1 = DateTime.Now.AddDays(1).Date, Group2="Group20"},
                new Test() { Group1 = DateTime.Now.AddDays(1).Date, Group2="Group30"},
                new Test() { Group1 = DateTime.Now.AddDays(2).Date, Group2="Group40"},
                new Test() { Group1 = DateTime.Now.AddDays(2).Date, Group2="Group50"},
                new Test() { Group1 = DateTime.Now.AddDays(3).Date, Group2="Group60"},
                new Test() { Group1 = DateTime.Now.AddDays(3).Date, Group2="Group70"}
            };
     
            RadGrid1.DataSource = tests;
     
        }
    }
     
    public class Test
    {
        public DateTime Group1
        { get; set; }
        public string Group2
        { get; set; }
    }

    Thanks,
    ilan.
  15. Nicolaï
    Nicolaï avatar
    160 posts
    Member since:
    Apr 2008

    Posted 14 Dec 2012 Link to this post

    Check this out:
    http://www.telerik.com/versionnotes.aspx?id=3074#radgrid

    Just a heads up. Telerik bugs everywhere!
    I just spent two hours trying to fix this one:
    - Fixed: RadGrid pager is not rendered when data is grouped in .NET35

    So, the latest builds usually not recommended for prod, but the main versions are just as bugged.
    5 hours into my work day, and it's been spent entirely trying to fix bugs from telerik. From a security warning caused by the radwindow, to paging in radgrids gone, to grouping issues. Arrrr.

    The general quality is just going down and down. My confidence in Telerik has gone from "just overwrite dll files, we'll be fine, telerik is solid" (up to mid 2011), to "wait, we need to test EVERYTHING before updating; can't trust em."

    After this project, I'll look into other control suites.
  16. Radoslav
    Admin
    Radoslav avatar
    1564 posts

    Posted 17 Dec 2012 Link to this post

    Hi,

    @Ilan
    Indeed I verified that the described issue exists into the current version of our controls. Our developers are aware and they will start working on the resolution of this issue. Additionally as a small token of gratitude for your involvement I have updated your Telerik points. At a meantime as a workaround you could try setting the EnableLinqGrouping property to “false”.
     
    @Nicolaï the pointed link leads to the page where we announce all fixed issue into our controls. So into the Q3 SP1 all issues listed into the mentioned page are fixed. Additionally the Service Packs of our controls can be used in a production and we recommend that. We do not recommend using of internal hotfix dlls. But SP and hotfix are two different types. Here and here you could read about their differences.
    Also please note that the RadGrid is a huge control, it has a hundred of build in functionalities and every Q we include another or improve some of the existing functionalities. For example since Q3 2011 we have the new Linq based grouping mechanism. This type of grouping has a huge performance optimization and internally uses Dynamic Linq for grouping. The grouping is one of the major functionalities into the RadGrid and rewriting its logic is not so easy. So in some specific cases there might be some issues, however we do our best to fix them as soon as possible and provide a stable product to our customers.
    Additionally if you found and issue into our controls you could report it to us and our developers will fix it.

    All the best,
    Radoslav
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  17. Cedric
    Cedric avatar
    15 posts
    Member since:
    Apr 2008

    Posted 28 Mar 2013 Link to this post

    Had the same issue. Setting  EnableLinqExpressions="false" on the grid solved my problem.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017