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

Set the width of textbox once added to the detail section programatically

3 Answers 139 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Subrahmanya Kadiyala
Top achievements
Rank 1
Subrahmanya Kadiyala asked on 07 Dec 2011, 02:58 AM
Hi,

I have 2 sections in my report. One isTextbox and other is panel. The textbox is added to the detail section and then the panel. I want to set the width of textbox to the panel. I tried to do it in Textbox_itemDatabound property but no change. I see that once the report is rendered the colspan of td in which this textbox is set to 1 instead of 2. Is there any way of setting the width equivalent to the panel width before rendering the report.

Thanks in advance.
Subra

3 Answers, 1 is accepted

Sort by
0
Elian
Telerik team
answered on 07 Dec 2011, 05:03 PM
Hello Subrahmanya Kadiyala,

There is no problem to set the TextBox width programmatically:

textBox1.Width = new Unit(..
However you have to keep in mind that report items can grow when data is processed. Since the panel is a container it can get wider according to the items inside it. If you bind the TextBox width to the panel width the textbox will be as wide as the panel in design-time (if the panel gets wider afterwards, the textbox will not).

If you set the textBox Docking property to "Fill" it will take the space of the parent container (this combined with another panel that contains inside both the panel and the textbox, might serve your purpose). Kind regards,
Elian
the Telerik team

Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

0
Subrahmanya Kadiyala
Top achievements
Rank 1
answered on 07 Dec 2011, 09:30 PM
Hi,

Thanks for the reply. Do you mean to say that I have to add the textbox and panel in the panel which is parent container for them and in that set the docking property of textbox to fill?
Thanks,
Subra

0
Elian
Telerik team
answered on 09 Dec 2011, 03:56 PM
Hi Subrahmanya Kadiyala,

Yes, this is what I meant, sorry for the created confusion. That of course is if the first case I mentioned, doesn't suit you. 

Greetings,
Elian
the Telerik team

Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

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