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

Increase the textboxes height same as details section height

4 Answers 382 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Syed
Top achievements
Rank 1
Syed asked on 27 May 2009, 10:09 PM
Hi,

I place few textboxes in the details section which i am displaying data through programmatically. And i am doing conditional formatting with few of the textboxes with changing the background colors and everything works. But Few textboxes contains lot of text which shows increasing height and few of them are small but does increase the height. I did conditional formatting to change the background colors of these small textboxes which does not increase in height as the other textboxes so that the height is equally to details section.

Even i try in code but does not effect anything for small textboxes.

Public Sub New()
        InitializeComponent()
        DisplayData()
        M1.Height = Me.detail.Height
        M2.Height = Me.detail.Height
        M3.Height = Me.detail.Height
        M4.Height = Me.detail.Height
        M5.Height = Me.detail.Height
        M6.Height = Me.detail.Height
        M7.Height = Me.detail.Height
        M8.Height = Me.detail.Height
        M9.Height = Me.detail.Height
End Sub



Pleae tell me how to increase the height of the textboxes dynamically what ever height of details section.

Thanks.

Regards
Syed Arshad

4 Answers, 1 is accepted

Sort by
0
Syed
Top achievements
Rank 1
answered on 27 May 2009, 10:13 PM
Please find the code as i extracted as one of the example of textbox:

 FormattingRule1.Filters.AddRange(New Telerik.Reporting.Data.Filter() {New Telerik.Reporting.Data.Filter("M1", CType(Telerik.Reporting.Data.FilterOperator.GreaterThan, Telerik.Reporting.Data.FilterOperator), "120")}) 
        FormattingRule1.Style.BackgroundColor = System.Drawing.Color.Red 
        FormattingRule2.Filters.AddRange(New Telerik.Reporting.Data.Filter() {New Telerik.Reporting.Data.Filter("m1", CType(Telerik.Reporting.Data.FilterOperator.GreaterOrEqual, Telerik.Reporting.Data.FilterOperator), "90"), New Telerik.Reporting.Data.Filter("m1", CType(Telerik.Reporting.Data.FilterOperator.LessOrEqual, Telerik.Reporting.Data.FilterOperator), "120")}) 
        FormattingRule2.Style.BackgroundColor = System.Drawing.Color.Green 
        FormattingRule3.Filters.AddRange(New Telerik.Reporting.Data.Filter() {New Telerik.Reporting.Data.Filter("m1", CType(Telerik.Reporting.Data.FilterOperator.GreaterOrEqual, Telerik.Reporting.Data.FilterOperator), "60"), New Telerik.Reporting.Data.Filter("m1", CType(Telerik.Reporting.Data.FilterOperator.LessThan, Telerik.Reporting.Data.FilterOperator), "90")}) 
        FormattingRule3.Style.BackgroundColor = System.Drawing.Color.Yellow 
        FormattingRule4.Filters.AddRange(New Telerik.Reporting.Data.Filter() {New Telerik.Reporting.Data.Filter("m1", CType(Telerik.Reporting.Data.FilterOperator.LessThan, Telerik.Reporting.Data.FilterOperator), "60")}) 
        FormattingRule4.Style.BackgroundColor = System.Drawing.Color.Purple 
        Me.M1.ConditionalFormatting.AddRange(New Telerik.Reporting.Drawing.FormattingRule() {FormattingRule1, FormattingRule2, FormattingRule3, FormattingRule4}) 
        Me.M1.Location = New Telerik.Reporting.Drawing.PointU(New Telerik.Reporting.Drawing.Unit(6.5331249237060547, CType(Telerik.Reporting.Drawing.UnitType.Inch, Telerik.Reporting.Drawing.UnitType)), New Telerik.Reporting.Drawing.Unit(0.000039418537198798731, CType(Telerik.Reporting.Drawing.UnitType.Inch, Telerik.Reporting.Drawing.UnitType))) 
        Me.M1.Name = "M1" 
        Me.M1.Size = New Telerik.Reporting.Drawing.SizeU(New Telerik.Reporting.Drawing.Unit(0.40000000596046448, CType(Telerik.Reporting.Drawing.UnitType.Inch, Telerik.Reporting.Drawing.UnitType)), New Telerik.Reporting.Drawing.Unit(0.25999999046325684, CType(Telerik.Reporting.Drawing.UnitType.Inch, Telerik.Reporting.Drawing.UnitType))) 
        Me.M1.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Solid 
        Me.M1.Style.Font.Name = "Verdana" 
        Me.M1.Style.Font.Size = New Telerik.Reporting.Drawing.Unit(8, CType(Telerik.Reporting.Drawing.UnitType.Point, Telerik.Reporting.Drawing.UnitType)) 
        Me.M1.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Center 
        Me.M1.StyleName = "Data" 
        Me.M1.Value = "=Fields.M1" 

0
Accepted
Steve
Telerik team
answered on 28 May 2009, 07:40 AM
Hello Syed,

I've just tried your scenario and as you can see from the attached movie it works as expected. Please check for what else might be interfering with this on your end.
Generally this can be achieved "automatically" by either using the table layout approach from this help article or using our table report item directly.

Best wishes,
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.
0
Syed
Top achievements
Rank 1
answered on 28 May 2009, 10:24 AM
Thanks Steve,

My anchor property was none before. I just change it to "Top, Bottom, Left, Right", everything works fine.

But the text are not align in the center. I just check the textbox properties text-align is center and Verticalalign is middle.  I see text is appearing on the top vertical align.

Thanks.
0
Steve
Telerik team
answered on 28 May 2009, 11:13 AM
Hi Syed,

The anchor property of the items shown in my video is none as well and this approach is working fine. Anyway the text-align is correctly being applied on my end. Please always provide more details when reporting such issues. Claiming that a single property does not have effect does not help as it is highly unlikely that this passed through our testing. If this is the case, it is most likely due to other settings or your custom scenario, which we have no way of knowing about.

All the best,
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
Syed
Top achievements
Rank 1
Answers by
Syed
Top achievements
Rank 1
Steve
Telerik team
Share this question
or