Click here to Skip to main content
15,913,758 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Heelo guys

I have a column in a gridview now the data inside label is not centered with my header.Below is my column...How can i make the text be centered?

<asp:TemplateField HeaderText="Employee Name">

          <itemtemplate>

 <asp:Label ID="Label1" runat="server" Text='<%# Bind("Fullname") %>'>
           </itemtemplate>


[Edited]Code is wrapped in "pre" tag[/Edited]
Posted
Updated 16-Oct-11 4:33am
v2

1 solution

How about:
<asp:TemplateField HeaderText="Employee Name">
<itemtemplate> 
  <asp:Label ID="Label1" runat="server" Text='<%# Bind("Fullname") %>'>
</itemtemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>


Best regards
Espen Harlinn
 
Share this answer
 
Comments
Anele Ngqandu 16-Oct-11 10:48am    
thank you...
Espen Harlinn 16-Oct-11 11:08am    
Excellent

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900