Zoplax
asked on
GridView - Text alignment in Edit mode?
I have a GridView with TemplateField objects in which I'm setting the ItemStyle-HorizontalAlign so that the text in the cell appears right-justified.
Is it possible to make it so that the text in my GridView cell is right-justified in Edit mode, and if so how can I set this programmatically?
Is it possible to make it so that the text in my GridView cell is right-justified in Edit mode, and if so how can I set this programmatically?
<asp:TemplateField HeaderText="Rate/Adder" ControlStyle-Width="100" ItemStyle-HorizontalAlign="Right">
<ItemTemplate>
<asp:TextBox id="txtBlendAdderValue" Text='<%# Bind("BlendAdderValue") %>' AutoPostBack="true" OnTextChanged="txtBlendAdderValue_TextChanged" Columns="40" MaxLength="255" CssClass="form" runat="server" />
</ItemTemplate>
</asp:TemplateField>
I'm pretty sure ItemStyle-HorizontalAlign= "Right" would align all template fields.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thanks, I ended up having to add this in within the textbox object's tag. For some reason even though I applied it via my css stylesheet, the change wouldn't take; I'm guessing it may've been overridden by other style settings in parent containers (I saw something about placeholder containers' styles sometimes showing this behavior).