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

EXPAND - COLLAPSE GRID WITH GROUPS

3 Answers 97 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dave Navarro
Top achievements
Rank 2
Dave Navarro asked on 08 Dec 2008, 08:16 AM

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

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 08 Dec 2008, 01:03 PM
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.
0
Dave Navarro
Top achievements
Rank 2
answered on 08 Dec 2008, 04:41 PM
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
0
Dave Navarro
Top achievements
Rank 2
answered on 09 Dec 2008, 04:43 PM
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
Tags
Grid
Asked by
Dave Navarro
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Dave Navarro
Top achievements
Rank 2
Share this question
or