ASP.NET MVC 4 Grid State grouping issue

5 posts, 0 answers
  1. Anas
    Anas avatar
    3 posts
    Member since:
    Aug 2012

    Posted 22 Nov 2013 Link to this post


    I have a issue while trying save the grid state and loading it back if grouping is there "Uncaught TypeError: Cannot read property 'length' of undefined "

    Steps to reproduce
    1. Go to Products link in home page.
    2. Group with any column in the grid (which will save the state to local storage).
    3. refresh the page (this gives the error mentioned above in developer options console).

    Please provide a suitable resolution for the same.

    Note: I have attached the sample project (

  2. Daniel
    Daniel avatar
    2110 posts

    Posted 25 Nov 2013 Link to this post

    Hello Anas,

    I posted my reply in the support ticket that you have opened with the same question. For convenience, I am pasting it below:

    You should use the autoBind option to prevent the initial binding when using this approach e.g.
    Otherwise, the initial request will still be made and an error will be thrown when there are groups but not grouped data is returned from the server.

    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET AJAX banner
  4. Tonny
    Tonny avatar
    1 posts
    Member since:
    Jul 2013

    Posted 16 Jan 2014 Link to this post

    Hi Daniel,

    I tried the attached sample project with your recommendation to set auto binding to false but it still does not work. Whenever I drop a column to the head for grouping the error occurred.

    I actually could not make this grouping feature working at all.

    Using this sample project, I updated a little bit to remove the event but just add group  as following code






    "Products").Columns(c => {

    c.Bound(p => p.Name);

    c.Bound(p => p.Supplier.Name).Title(



    c.Bound(p => p.Category.Name).Title(



    c.Bound(p => p.UnitPrice).Format(



    c.Bound(p => p.UnitsInStock);

    c.Bound(p => p.Discontinued);


    .DataSource(d => d


    .Read(r => r.Action(


    "Get", "Products"))









    //.Events(e => e.DataBound("SaveLayout"))


    This does not work at all. As long as I run this, it has the exception saying Unable to get value of the property 'length' (please see attached files for detail). I also opened a ticket for you 777459

    Can you please let me know how could I make the grouping feature working?


  5. Haluk
    Haluk avatar
    5 posts
    Member since:
    Feb 2014

    Posted 18 Mar 2014 Link to this post

    Can you help me on this post
  6. Daniel
    Daniel avatar
    2110 posts

    Posted 20 Mar 2014 Link to this post

    Hello Haluk,

    The topic of this thread differs from the one that you provided. Please post any additional questions that you may have on that topic there. 


    Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

Back to Top
UI for ASP.NET AJAX banner