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

find textbox.height at runtime

1 Answer 149 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
John Even
Top achievements
Rank 1
John Even asked on 11 May 2009, 11:36 AM
Hi, I have some textboxes in pageHeader which may have grown. If they have grown I need to expand the pageHeader.Height accordingly. But at runtime I can only see the initial height for a textbox. How can I find the correct height for a textbox?

The textbox is populated in the .ctor for the report.
public myReport(object[] params){
InitializeComponent();
if(.... some params checks)
txtHeader.Value += "Filter1" + Environment.NewLine

//Here I want to add the height of the pageHeader... something like
pageHeader.Height = txtHeader.Height + new Unit("2cm");  //does not work since txtHeader.Height always equals the height set in designtime...

rgds
john even pedersen

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 12 May 2009, 12:52 PM
Hello John,

Page headers and footers are not related to the report itself, but are relative to the margins of the report's media, i.e. to the paper or screen. Thus they are always static and this is by design. You have two options:
  • make the pageheader with such height that it would always fit the textbox content.
  • use unbound group (no grouping criteria) as substitute for page header/footer. This section would automatically grow depending on its children. I've attached a sample report showing this approach.
Hope this helps.
Regards,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
John Even
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or