C# .NET - please help urgent... i want grid view control with fixed header and footer

Asked By sireesha sireesha on 20-Feb-13 01:33 AM
 want grid view control with fixed header and footer while scrolling vertically.
Justin Deva replied to sireesha sireesha on 20-Feb-13 02:27 AM


 

<asp:GridView ID="GridView2" runat="server" AllowPaging="True"

AutoGenerateColumns="False" BackColor="White" BorderColor="White"

BorderStyle="Ridge" BorderWidth="2px" CellPadding="3" CellSpacing="1"

GridLines="None"

Width="550px"

>

<RowStyle BackColor="#DEDFDE" ForeColor="Black" HorizontalAlign="Left"

VerticalAlign="Middle" />

<EmptyDataRowStyle Font-Bold="true" ForeColor="Red" />

<EmptyDataTemplate>

No Details Found!!!

</EmptyDataTemplate>


<Columns>


<asp:TemplateField HeaderText="S No">

<ItemTemplate>

<%#Container.DataItemIndex+1 %>

</ItemTemplate>

</asp:TemplateField>


<asp:TemplateField HeaderText="Name">

<ItemTemplate>

<asp:Label ID="lblName" runat="server" Text='<%#Eval("") %>'>

</asp:Label>

</ItemTemplate>

</asp:TemplateField>



</Columns>


<FooterStyle BackColor="#C6C3C6" ForeColor="Black" />

<PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />

<SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />

<HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF"

HorizontalAlign="Left" VerticalAlign="Middle" />

</asp:GridView>