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

Hide grouping column of a crosstab

1 Answer 202 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ranasinghe,
Top achievements
Rank 1
Ranasinghe, asked on 02 Apr 2015, 08:09 AM
Hi All

I am using a crosstab for generating a report. Now there is a new requirement, based on the users input there are some columns to be hide. I did follow some approaches and end up with the same problem.

1. Use bindings for the column and set visible false. Resulting column not visible but still white space is still there. (this happens only for grouped columns)
2. Set width to be 0 for the column index. Columns are hidden but space for the header still there and last column header of the grouping is missing

Is there a way to hide any column including header of the crosstab according to the index of the column from left.

following is the code i used for set width of columns

            
int count = 0;
var rowGroups = this.crosstab1.RowGroups;
while (rowGroups != null)
{
    foreach (var group in rowGroups)
    {
        if (hideColumnIndexes.Contains(count))
        {
            group.ReportItem.Width = new Telerik.Reporting.Drawing.Unit(0.000000,
                Telerik.Reporting.Drawing.UnitType.Inch);
        }
    }
    if (rowGroups.Any())
    {
        rowGroups = rowGroups[0].ChildGroups;
    }
    else
    {
        rowGroups = null;
    }
    count++;
}



1 Answer, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 02 Apr 2015, 03:13 PM
Hello Ranasinghe,

The recommended approach to hide rows/columns in the Crosstab item is using Filtering. You can apply filtering to the row groups or column groups, or apply filtering on the detail rows.
For more information, please go through the articles in the Filtering Data section.

Regards,
Nasko
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
General Discussions
Asked by
Ranasinghe,
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Share this question
or