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

collapse (hide) the details section

2 Answers 452 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dragoljub
Top achievements
Rank 1
Dragoljub asked on 05 Feb 2008, 02:27 PM
I just want to share this with everyone. Here is how I managed to remove the "empty space" in the details section, so the group data is next to one another.

This code is inside a detail.ItemDataBound event, so "sender" is a Processing.DetailSection object, and based on one of DataItem's attributes I hide all the Items and the section itself.

Dim section As Processing.DetailSection = CType(sender, Processing.DetailSection)  
 
Dim rv As DataRowView = CType(section.DataItem, DataRowView)  
If CType(rv.Row("TagCount"), Integer) = 0 Then 
    For i As Integer = 0 To section.Items.Count - 1  
        section.Items(i).Visible = False 
    Next 
    section.Visible = False 
End If 

2 Answers, 1 is accepted

Sort by
0
Hrisi
Telerik team
answered on 06 Feb 2008, 03:45 PM
Hi Dragoljub,

Your approach is right but there is no need for setting Visible=False for all child items of the detail section.

The same effect can be accomplished by setting Visible=False of the detail section in Design time. Furthermore, you can remove detail section manually from the Designer generated code (there is no design time support for this) and the report should continue to work.

Best wishes,
Hrisi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Dragoljub
Top achievements
Rank 1
answered on 06 Feb 2008, 03:55 PM
This was a specific case of report where not all of the groups contained "details". So this had to be done runtime, on databound event for each detail section "instance".

If I were to hide the details section in the designer, or remove it from the designer generated code, that would change the definiton of the report and it would affect the whole report.

I removed the loop where all the items were set to be invisible, and it works as you said. Only the section has to be set to invisible.

Thanks,
Dragoljub
Tags
General Discussions
Asked by
Dragoljub
Top achievements
Rank 1
Answers by
Hrisi
Telerik team
Dragoljub
Top achievements
Rank 1
Share this question
or