Grouping Gridview Columns

Posted by Sahoomanoj27 under ASP.NET on 8/20/2012 | Points: 10 | Views : 1663 | Status : [Member] | Replies : 2
How to group the columns in gridview..
It's Urgent

Thank U
Manoj Sahoo




Responses

Posted by: Nadh123 on: 8/23/2012 [Member] Starter | Points: 25

Up
0
Down
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px"
CellPadding="2" ForeColor="Black" GridLines="None" Width="355px">
<Columns>
<asp:TemplateField>
<HeaderTemplate>
Name
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblname" runat="server" Text='<%#Eval("Name") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Class
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="lblname" runat="server" Text='<%#Eval("class") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
<table>
<tr>
<td colspan="3">
Marks
</td>
</tr>
<tr>
<td>
Maths
</td>
<td>
Computers
</td>
<td>
Science
</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table>
<tr>
<td>
<asp:Label ID="lblname" runat="server" Text='<%#Eval("Maths") %>'></asp:Label>
</td>
<td>
<asp:Label ID="Label1" runat="server" Text='<%#Eval("Science") %>'></asp:Label>
</td>
<td>
<asp:Label ID="Label2" runat="server" Text='<%#Eval("class") %>'></asp:Label>
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="Tan" />
<PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue"
HorizontalAlign="Center" />
<SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
<HeaderStyle BackColor="Tan" Font-Bold="True" />
<AlternatingRowStyle BackColor="PaleGoldenrod" />
</asp:GridView>

Mahendra
91-9908699686

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

Posted by: Sahoomanoj27 on: 8/23/2012 [Member] Starter | Points: 25

Up
0
Down
Thanks for ur Reply...
Can u please tell me how to group rows dynamically in a gridview.

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

Login to post response