views:

25

answers:

1

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", "../../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.

A: 

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"
Scott