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

Grouped column in table should appear only once

1 Answer 81 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sagar
Top achievements
Rank 1
Sagar asked on 11 Mar 2012, 06:37 PM
Hi,

I have created a report using table. 
At present:I am getting

column1  column2  column3
-----------------------------
fruit         apple         red
fruit        banana       green
fruit        mango       yellow
car         toyota       black
car         nissan        silver

What I want is:

column1  column2  column3
-----------------------------
fruit         apple         red
              banana       green
              mango       yellow
car         toyota       black
              nissan        silver

So as you can see, grouped column is getting repeated for all grouped rows. However I want it to appear only once.
Heres my code :


// coll is a collection  & my datasource
 this.table1.DataSource = coll;
            
             TableGroup group = new TableGroup { Name = "Territory" };
                group.Groupings.Add(new Telerik.Reporting.Data.Grouping("=Fields.Territory"));
 
  
                //Remove the detail group
                var detailGroup = table1.RowGroups[0];
                table1.RowGroups.Clear();
  
                //Add the detail group as a child to the AgeGroup (nest it)
                group.ChildGroups.Add(detailGroup);
                group.GroupKeepTogether = true;
                //Add the AgeGroup
                table1.RowGroups.Add(group);
 Any suggestions ?

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 15 Mar 2012, 11:08 AM
Hi Sagar,

You need to create a parent row group that groups by Column1. I've attached a sample report that shows the desired functionality.

Kind regards,
Steve
the Telerik team
NEW in Q1'12: Telerik Report Designer (Beta) for ad-hoc report creation. Download as part of Telerik Reporting Q1 2012. For questions and feedback, use the new Telerik Report Designer Forum.
Tags
General Discussions
Asked by
Sagar
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or