开发者

Problem right aligning statictextfield controls

开发者 https://www.devze.com 2023-01-13 21:58 出处:网络
So I am adding StaticTextField controls to a page. This is using ExtJS, but we use VB.NET methods to add ExtJS so we don\'t actually have to write it.

So I am adding StaticTextField controls to a page. This is using ExtJS, but we use VB.NET methods to add ExtJS so we don't actually have to write it.

I tried using

.Style = "text-align:right"

But that isn't working, in fact it isn't doing anything. Here is the whole code of one of the controls:

With .AddColumns(2)
                With .Item(1)
                    .LabelWidth = 150
                    With .AddControl(New Forms.Control("LoanProceeds", "../../开发者_Python百科loanProceeds", "Loan Proceeds", IIf(Model.LoanProceeds <> 0, Model.LoanProceeds, "$0.00"), Forms.Control.ControlType.StaticTextField))
                        .Validate.AllowNegative = False
                        .Validate.AllowDecimals = True
                        .Style = "text-align:right"
                        .ReadOnly = True
                    End With

All these controls are contained within a column, which is contained within a fieldset, which is contained within a panel.

Anyone have any idea why these aren't right aligning using CSS? For some reason, if I try to use the same code above (the CSS), to try and right align comboboxes, or number fields, it works, and they are located right underneath these static controls, but it's not working for static controls. They need to be static because we don't want the "box" outline on each of the values, we just want it to be text, nothing else on the screen.

Any help would be greatly appreciated.


Sorry to answer my own question but I just figured it out.

Instead of using

.Style = "text-align:right"

You need to use

.ValueStyle = "text-align:right"
0

精彩评论

暂无评论...
验证码 换一张
取 消