To align each gridview item

Posted by Amritha444 under ASP.NET on 9/30/2010 | Points: 10 | Views : 7328 | Status : [Member] | Replies : 3
what my problem is i want to centralize the gridview items .now it seems in the left align mode.following is the gridview source code

<asp:GridView ID="GrdAttendenceList" runat="server" Width="800px"
onrowdatabound="GrdAttendenceList_RowDataBound" >
<EmptyDataTemplate>
<table style="width: 100%">
<tr>
<td align="center">
No Data to Display</td>
</tr>
</table>
</EmptyDataTemplate>
</asp:GridView>
How to make each item in the grid view center align.here iam binding values not manually given

Thanks in Advance




Responses

Posted by: Amritha444 on: 9/30/2010 [Member] Starter | Points: 25

Up
0
Down
I got answer by using row style -horizontalalign

Amritha444, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: T.saravanan on: 9/30/2010 [Member] [MVP] Silver | Points: 25

Up
0
Down
Hi Amritha,

Just add css file and then call that file into your gridview you can solve your problem.

Here i am given a link for your reference.

http://forums.asp.net/t/1047780.aspx

http://www.asp.net/data-access/tutorials/displaying-summary-information-in-the-gridview-s-footer-cs

Cheers :)

Thanks,
T.Saravanan

Amritha444, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Lalji_mer on: 10/2/2010 [Member] Bronze | Points: 25

Up
0
Down
if you want to more clarification then you can visit below link.

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.horizontalalign.aspx

Thanks .

LP MER

Amritha444, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response