PDA

View Full Version : How to change size of a label in a NumberField



extNewBee
May 23, 2012, 7:56 PM
Hi,
I am currently using Ext.Net 1.3. I am trying to reduce the gap between the Label and the text box within the NumberField control but with no success. I tried changing the LabelWidth property and the ".x-form-item-label" css but that didn't work.
In my example, I would like the textbox to be closer to the word "age". Does anyone know how to reduce the width of the label column?

Below is my code :


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestRuns.aspx.cs" Inherits="Web.Pages.TestRuns" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
<link href="../Resources/css/css.css" rel="stylesheet" type="text/css" />
</head>
<body>

<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<div>
<br /><br />
<ext:NumberField ID="age" FieldLabel="Age" runat="server" />
</div>
</form>

</body>
</html>

obroc17
May 24, 2012, 1:50 AM
I tried your code and applied the LabelWidth property in the NumberField and its working fine. It maybe in your css which affects the layout.



<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<div>
<br /><br />
<ext:NumberField ID="age" FieldLabel="Age" runat="server" LabelWidth="40" />
</div>
</form>

extNewBee
May 24, 2012, 1:20 PM
Thanks for responding to my post. I realized that might be the cause after looking into the issure further.