learntechnology
asked on
GridView with ItemTemplate TextBox Right Align
Hi,
I'm trying to right align the textbox which is inside the GridView control. Here is the code:
Can anyone help me on how to get the textbox right-aligned when there is lengthy number displayed for e.g: 2220 or 22220 or 22000000.
I'm trying to right align the textbox which is inside the GridView control. Here is the code:
<asp:TemplateField HeaderText="Remaining Qty" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="10">
<ItemTemplate>
<asp:TextBox runat="server" ID="TextBoxInvRemQty" Text='<%# String.Format("{0:###,##0}", Convert.ToDouble(Eval("InvQty"))) %>'
BorderStyle="none" BackColor="transparent" Width="80px" ReadOnly="True" TabIndex="-1"></asp:TextBox>
</ItemTemplate>
Can anyone help me on how to get the textbox right-aligned when there is lengthy number displayed for e.g: 2220 or 22220 or 22000000.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I have tried in multiple ways and added style inside the item template textbox.
Open in new window