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

Working with table rows that have 0 height

2 Answers 152 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mihai Dinculescu
Top achievements
Rank 1
Mihai Dinculescu asked on 20 Oct 2011, 06:03 PM
Hello

I have this funny situation in which I made a table row have 0 height so I could hide/show it dynamically. However now in designer I'd like to expand it so I can work with it.

Any tips?

2 Answers, 1 is accepted

Sort by
0
Accepted
IvanY
Telerik team
answered on 25 Oct 2011, 01:49 PM
Hi Mihai Dinculescu,

You will not be able to "repair" your table in the Designer. However the code for the table row still exists, so you can modify it in the code behind file (MyReport.Designer.cs). The easiest way to do that is to press Ctrl + F and in the Find and Replace window to enter as search string 0D (in C# at least, might be 0 in VB.NET). The code that you search for looks like this (table1 is the name of your table):

this.table1.Body.Rows.Add(new Telerik.Reporting.TableBodyRow(new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Inch)));

Now you just have to substitute 0D with something meaningful, like 1D - this is just to make the row visible. When you go to the Designer your row will be visible and you will be able to edit it.

If you have set the Size of the first row to 0 the workaround will be more tricky - you have to find that piece of code:

this.table1.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(6D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(2D, Telerik.Reporting.Drawing.UnitType.Inch));

The second size (with green) is the size that you have to increment with 1. However this will not be enough to visualize the first row - you will have to find all the items in the first row and change their sizes as well; this is how the code looks for a textbox:

this.textBox1.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(2D, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Inch));

Change the size from 0D to 1D for all the items in the header and switch to the Designer - if you have missed an item the cell will be empty and when you try to make a column/row selection with that cell in it you will see the following message: "Cannot select a cell with no report item".

All the best,
IvanY
the Telerik team

Q2’11 SP1 of Telerik Reporting is available for download (see what's new). Get it today.

0
Mihai Dinculescu
Top achievements
Rank 1
answered on 25 Oct 2011, 01:56 PM

Thank you very much Ivan for your elaborated answer.

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