Avatar of Camillia
CamilliaFlag for United States of America

asked on 

Shifting gridview headers to the left

I have a gridview (sceenshot attached). You see how the header is shifted to the right. I used controlstyle css to move it to the left but doesnt look like that's the correct one...

How can I do this? Part of the grid code is also below
<asp:TemplateField    HeaderText="User Name">
           <ItemTemplate  >
              <asp:Label ID="Labelx" runat="server" Text='<%# Eval("Username") %>' >
		        </asp:Label>
           </ItemTemplate>
           <EditItemTemplate >
               <asp:TextBox ID="txtUserName" runat="server" Text='<%# Eval("Username")%>'  ></asp:TextBox>
               <span class="feedback"><asp:RequiredFieldValidator ControlToValidate="txtUserName" runat="server" ID="rfv1" Text="User Name is required!" ErrorMessage="User Name is required!"></asp:RequiredFieldValidator></span>
           </EditItemTemplate>
               </asp:TemplateField>
           <asp:TemplateField  HeaderText="Business Name">
           <ItemTemplate>
               <asp:Label ID="Label1" runat="server" Text='<%# Eval("BusinessName") %>'></asp:Label>
           </ItemTemplate>
          
           </asp:TemplateField>

Open in new window

Doc3.docx
ASP.NET

Avatar of undefined
Last Comment
Tom Beck
Avatar of Tom Beck
Tom Beck
Flag of United States of America image

<asp:TemplateField HeaderText="User Name" HeaderStyle-HorizontalAlign="Left">
ASKER CERTIFIED SOLUTION
Avatar of Tom Beck
Tom Beck
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
ASP.NET
ASP.NET

The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications

128K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo