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

Show/hide table header at runtime

3 Answers 551 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 1
Joe asked on 02 May 2013, 05:23 PM
I am building a report with quite a few tables in it. Based on the data used to populate the report, I need to be able to show or hide the header row of the tables at runtime. How can this be achieved?

3 Answers, 1 is accepted

Sort by
0
IvanY
Telerik team
answered on 06 May 2013, 03:03 PM
Hello Joe,

You can use Bindings or Conditional Formatting to set the visibility of all the cells in the head row. You can use Report Parameters if you want this to be controlled by user input.

Kind regards,
IvanY
the Telerik team

Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

0
Joe
Top achievements
Rank 1
answered on 06 May 2013, 03:52 PM
Thanks for the reply. I set up some conditional formatting on a table, and was able to set the header cell to invisible. Unfortunately, there is a gap on the report where the header would normally be, as if the cell is invisible but the header row is still there. Is there a way I can hide the header row entirely so there's no gap?

Thanks again,
Joe
0
Elian
Telerik team
answered on 09 May 2013, 09:30 AM
Hi Joe,

As you have observed, even when the header is not visible the space taken by it remains. A quick way to make it shrink is to make the header very small at design-time (height 0.1cm for e.g.) or if you want to keep the design-time size normal, you can do it programmatically in the constructor after InitializeComponent().
When you set the table header to be very small when it is visible and it has data, it will grow and look normal run-time, when it is not visible, it won't grow. 
Another approach would be to dynamically build the header run-time with code. This way, you will be able to add it only when needed and when not, it won't take any space. 
 

Greetings,
Elian
the Telerik team

Have you tried the new visualization options in Telerik Reporting Q1 2013? You can get them from your account.

Tags
General Discussions
Asked by
Joe
Top achievements
Rank 1
Answers by
IvanY
Telerik team
Joe
Top achievements
Rank 1
Elian
Telerik team
Share this question
or