EXPAND - COLLAPSE GRID WITH GROUPS

4 posts, 0 answers
  1. Dave Navarro
    Dave Navarro avatar
    150 posts
    Member since:
    Jul 2005

    Posted 08 Dec 2008 Link to this post

    Hello,

    I have a quick question;

    I use the following method to expand and collapse grid rows (client side) when I have a hierarchical grid;

    *****************************************
    var RadGrid1 = $find("<%= RadGrid1.ClientID %>");
    for (var i = 0; i < RadGrid1.get_masterTableView().get_dataItems().length; i++) {
     var item = RadGrid1.get_masterTableView().get_dataItems()[i];
     var MasterTable = RadGrid1.get_masterTableView();
     var row = RadGrid1.get_masterTableView().get_dataItems()[i];
     var cell = MasterTable.getCellByColumnUniqueName(row, "ExpandColumn");

     if (cell.innerHTML != "") {
         if (gridExpanded == false) {
      item.set_expanded(true);
      gridChanged2 = true;
         }
         else {
      item.set_expanded(false);
      gridChanged2 = false;
         }
     }
    }
    gridExpanded = gridChanged2;
    *****************************************

    But now I need to expand and collapse a rid that is setup with Groups or "GroupBy" with GroupHeaders via client side code and I can't seem to find the proper object / property to make it work.

    Can you please point me in the right direction? How do I expand and collapse a grid with client side code that is grouped?

    Many thanks in advance,

    Dave

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

    Posted 08 Dec 2008 Link to this post

    Hi David,

    I hope the below link to code library for expanding/collapsing RadGrid from clientside, will help you to achieve the functionality.
    Expand/collapse grouped grid client-side on external control click

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Dave Navarro
    Dave Navarro avatar
    150 posts
    Member since:
    Jul 2005

    Posted 08 Dec 2008 Link to this post

    Hello and thanks for your reply.

    I'll see if I can make it work. I see a clue that looks promising however the code sample is for an older version of the grid and as we all know so many properties and methods have changed since the days of radControls for "ASP".

    If it turns out to be too outdated then I'll post a code snippet once I get a working version so others can see a working sample. If it works out as currently written in the sample then I'll state that so others will know it still works.

    Thanks again for your help!

    Dave
  5. Dave Navarro
    Dave Navarro avatar
    150 posts
    Member since:
    Jul 2005

    Posted 09 Dec 2008 Link to this post

    Well, after several frustrating hours of failures I finally decided to ask for help from telerik support.

    And...

    I was informed that this feature / functionality is no longer available. A work around was suggested but it was simply to use server side code and AJAX to complete the expand / collapse.

    So, unless someone has a cleaver client side work around we'll just have to wait for the functionality to be put back in.

    Thanks again,

    Dave
Back to Top