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

HTML Text Boxes not shrinking

1 Answer 63 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Zack
Top achievements
Rank 1
Zack asked on 12 Mar 2014, 08:31 PM
I have a report with a detail section that has a few html textboxes that have the value bound to a field. If that field is empty, I want the html textbox to shrink. I have CanShrink set to true. It works for regular textboxes. Am I missing something?

In the designer code I also set the visibility to false and the height and widths but it still keeps the report spaced out.

        private void detail_ItemDataBound(object sender, EventArgs e)
        {
            Telerik.Reporting.Processing.DetailSection procDetail = sender as Telerik.Reporting.Processing.DetailSection;

Telerik.Reporting.Processing.HtmlTextBox txtSpecialTests = (Telerik.Reporting.Processing.HtmlTextBox)Telerik.Reporting.Processing.ElementTreeHelper.GetChildByName(procDetail, "txtSpecialTests");

            if (txtSpecialTests != null)
            {
                if (txtSpecialTests.Value.ToString() == "")
                {
                    txtSpecialTests.Visible = false;
                    txtSpecialTests.Height = new Unit(0);
                    txtSpecialTests.Width = new Unit(0);
                }
            }
}

Thanks,

Zack

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 17 Mar 2014, 02:07 PM
Hello Zack,

Generally Telerik Reporting is data driven reporting solution. Thus when you want to hide the detail section based on some condition, our recommendation is set up a report Filter. Give it a try and if you need additional assistance please elaborate further on your scenario.

Regards,
Peter
Telerik
 

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

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