This is a migrated thread and some comments may be shown as answers.

Expand / Close group options

2 Answers 38 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andy Green
Top achievements
Rank 2
Andy Green asked on 01 Apr 2016, 03:57 PM

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 Answers, 1 is accepted

Sort by
0
Gidon
Top achievements
Rank 1
answered on 01 Apr 2016, 04:27 PM

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>

0
Andy Green
Top achievements
Rank 2
answered on 04 Apr 2016, 06:30 AM

Excellent , thank you.

 

Andy

Tags
Grid
Asked by
Andy Green
Top achievements
Rank 2
Answers by
Gidon
Top achievements
Rank 1
Andy Green
Top achievements
Rank 2
Share this question
or