Click here to Skip to main content
15,884,472 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a grid view
in this grid view is a templatefield
in this columns is 2 label
i want a label align right
and a label align left
how way a can alignment control in grid view?
Posted

You can put each in a div and align the div. You could also use a table.
 
Share this answer
 
Comments
sadegh_rusta 19-Jun-12 13:17pm    
how i can use div?
because try
but not allowed me to this
ZurdoDev 19-Jun-12 13:46pm    
In your contenttemplate just do <div><asp:Label... </div> and set CSS properties on your div.
Hi,
You can use html table inside the item template of templatefield to format your contents .
--AK
 
Share this answer
 
ASP.NET
<table width="100%">
<tr>
<td align="left"><asp:Label ID="lbl1" runat="server"></td>
<td align="right"><asp:Label ID="lbl2" runat="server"></td>
</tr>
</table>


Hope you got your solution..



Thanks
Ashish
 
Share this answer
 
v2

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