Expand / Close group options

3 posts, 0 answers
  1. Andy Green
    Andy Green avatar
    342 posts
    Member since:
    Aug 2008

    Posted 01 Apr Link to this post

    Hi

    I have a RadGrid with grouping, and the expand / close the group with the icon on the left hand side. We have a request that the groups be expanded / closed from the cell that has the group header text, is this possible.

    The action would have to toggle so it closes when open and opens when closed.

    I have attached an image that shows our requirement.

    Andy

  2. Gidon
    Gidon avatar
    7 posts
    Member since:
    Apr 2014

    Posted 01 Apr in reply to Andy Green Link to this post

    This is a fairly easy tweak using jQuery:

    function GridCreated(sender, eventArgs) {
      // Set group header rows as clickable
      $(".rgGroupHeader").each(function () {
        $(this).find("input").click(function (event) {
          // Prevent bubbling from initiating an infinite loop
          event.stopPropagation();
        });
        $(this).click(function () {
          // Pass the click on to the expand/collapse button
          $(this).find("input").click();
        });
      });
    }

    Then just wire up the event in your RadGridmarkup:

    <ClientSettings AllowGroupExpandCollapse="True">
      <ClientEvents OnGridCreated="GridCreated" />
    </ClientSettings>

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Andy Green
    Andy Green avatar
    342 posts
    Member since:
    Aug 2008

    Posted 04 Apr in reply to Gidon Link to this post

    Excellent , thank you.

     

    Andy

Back to Top