View Full Version : [CLOSED] TextField align with StyleSpec

Jan 24, 2012, 11:21 AM
In version 1.x, I used a stylespec to align the text in textfield with the code bellow... and this code works very fine...

<ext:TextField runat="server" ID="txtMulta" FieldLabel="Multa (%)" Text="0,00" MaxLength="10" StyleSpec="text-align:right" EnableKeyEvents="true" X="320" Y="50" Width="85px">

But, after a upgrade the ext.net to 2.x, the LABEL of field is align to right, and the text still left-aligned.


I believe it may have changed the way to do this aligment... any help?

Jan 24, 2012, 2:45 PM

Confirmed, it won't work in v2 anymore.

The two possible solutions are below.


<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Ext.NET v2 Example</title>

<style type="text/css">
.my-text-field input.x-form-text {
text-align: right;
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:TextField runat="server" Text="Hello World!" FieldStyle="text-align: right;" />
<ext:TextField runat="server" Text="Hello World!" Cls="my-text-field" />

Jan 24, 2012, 2:56 PM
Hi Daniil

Thanks for your response

Using FieldStyle="text-align: right;" , works fine...

Thanks a lot