Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET Gridview
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 19-Jun-12 5:13am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You can put each in a div and align the div. You could also use a table.
  Permalink  
Comments
sadegh_rusta at 19-Jun-12 13:17pm
   
how i can use div?
because try
but not allowed me to this
ryanb31 at 19-Jun-12 13:46pm
   
In your contenttemplate just do <div><asp:Label... </div> and set CSS properties on your div.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Hi,
You can use html table inside the item template of templatefield to format your contents .
--AK
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

<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
  Permalink  
v2

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

  Print Answers RSS
0 OriginalGriff 270
1 Sergey Alexandrovich Kryukov 150
2 ChauhanAjay 120
3 BotCar 105
4 Dave Kreskowiak 100
0 Sergey Alexandrovich Kryukov 9,056
1 OriginalGriff 8,041
2 CPallini 2,613
3 Richard MacCutchan 2,221
4 Abhinav S 1,928


Advertise | Privacy | Mobile
Web04 | 2.8.140827.1 | Last Updated 20 Jun 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100