Fixed height of details section or panel

4 posts, 0 answers
  1. Christian
    Christian avatar
    22 posts
    Member since:
    Nov 2008

    Posted 30 Oct 2012 Link to this post

    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
  2. IvanY
    Admin
    IvanY avatar
    417 posts

    Posted 02 Nov 2012 Link to this post

    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!

  3. DevCraft banner
  4. Christian
    Christian avatar
    22 posts
    Member since:
    Nov 2008

    Posted 04 Nov 2012 Link to this post

    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
  5. IvanY
    Admin
    IvanY avatar
    417 posts

    Posted 05 Nov 2012 Link to this post

    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!

Back to Top