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

Fixed height of details section or panel

3 Answers 168 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Christian
Top achievements
Rank 1
Christian asked on 30 Oct 2012, 10:04 PM
Hi
I've got a multi column report that is used for address labels. I'm configuring the height of the individual labels programmatically and I'm also adding textboxes programmatically.
How can I ensure that the details area does not grow if the contained textboxes use too much height? I want the textboxes that do not fit inside the details section's height just to be cut.
I've tried with a panel and setting it's height and adding the textboxes to that panel but the panel also grows automatically just like the details section.
Can please anybody tell me how to accomplish fixed height of labels?

Best regards

Christian

3 Answers, 1 is accepted

Sort by
0
IvanY
Telerik team
answered on 02 Nov 2012, 09:08 AM
Hello Christian,

There is a fairly easy solution to your issue actually. TextBox item (along with HtmlTextBox and CheckBox) have CanGrow property. Setting this one to false will prevent the item to grow and will just cut the text in your case. For more information about shrinking and growing items you can check this frequently asked question.

As a best practice we can recommend to play a little more with the designer and after that to check the resulting code in the designer.cs (or designer.vb) file - that way you will get to know the product much better and you will be more comfortable with the options that each item provides.

Greetings,
IvanY
the Telerik team

HAPPY WITH TELERIK REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

0
Christian
Top achievements
Rank 1
answered on 04 Nov 2012, 08:47 PM
Hello IvanY

Thank you for your reply. To set CanGrow to false would solve the problem of growing textboxes but it would also break my existing approach to have the textboxes automatically sized. As I've mentioned, the textboxes are placed on the report programmatically. The user can also choose the font size and until now it was not necessary to calculate the textbox height needed because the CanGrow did exactly what was needed. The user can also add too many textboxes to the report which makes the labels overflow and become too big for the physical sticky labels. So I'd still prefer to lock the size of some container panel or the details section. But if you say I cannot do that, I'll have to follow your solution with CanGrow. Isn't there any solution to lock the height of a panel?

Best regards

Christian
0
IvanY
Telerik team
answered on 05 Nov 2012, 07:54 PM
Hello Christian,

Currently there is no way to restrict the Panel item from growing if its contents need the space. Because of that you will really have to use the CanGrow property of the TextBox and cut the text instead.

Greetings,
IvanY
the Telerik team

HAPPY WITH TELERIK REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

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