Jump to content

wanna fix the grid view headers fixed/freeze


kundan

Recommended Posts

Hello,

i wanna freeze the grid view header fixed just like in excel as we scroll the rows scrolls away lea ving the column heading fixed

I wanna perform this action using css in asp.net

this is my code in asp.net

<td style="padding-left: 5px" colspan="3">
<asp:Panel ID="pnlExclusionList" runat="server" Width="98%" Height="150px" ScrollBars="Vertical">
<asp:GridView runat="server" ID="gridXponentExclusionList" Width="100%" TabIndex="15"
AutoGenerateColumns="False" Style="border-collapse: collapse;" OnRowDataBound="gridXponentExclusionList_RowDataBound">
<HeaderStyle CssClass="HeaderStyle" HorizontalAlign="Left"></HeaderStyle>
<AlternatingRowStyle CssClass="AltRowStyle"></AlternatingRowStyle>
<Columns>
<asp:TemplateField HeaderText="Select">
<ItemStyle Width="12%"></ItemStyle>
<HeaderStyle CssClass="clsLabel"></HeaderStyle>
<ItemTemplate>
<%--<asp:CheckBox ID="chkXponentExclusionList" runat="server" AutoPostback="true" OnCheckedChanged="chkXponentExclusionList_CheckedChanged"></asp:CheckBox>--%>
<asp:CheckBox ID="chkXponentExclusionList" runat="server" AutoPostBack="false"></asp:CheckBox>
<asp:Label ID="lblExclusionList" Visible="false" Text='<%# DataBinder.Eval (Container.DataItem, "XPON_EXCL_LIST_ID") %>'
runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Label">
<ItemStyle Width="11%"></ItemStyle>
<HeaderStyle CssClass="clsLabel"></HeaderStyle>
<ItemTemplate>
<asp:Label ID="XponentExclusionList" Visible="True" Text='<%# DataBinder.Eval (Container.DataItem, "XPON_LIST_VALUE") %>'
runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Date Created">
<ItemStyle Width="20%"></ItemStyle>
<HeaderStyle CssClass="clsLabel"></HeaderStyle>
<ItemTemplate>
<asp:Label ID="lblCreatedDate" Visible="true" Text='<%# Bind("CREATED_ON", "{0:MM/dd/yyyy}") %>'
runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Physicians Count">
<ItemStyle Width="50%"></ItemStyle>
<HeaderStyle CssClass="clsLabel"></HeaderStyle>
<ItemTemplate>
<asp:Label ID="lblNoOfPhysicians" Visible="true" Text='<%# DataBinder.Eval (Container.DataItem, "NO_OF_PHY") %>'
runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField Visible="False" HeaderText="Description">
<ItemStyle Width="60%"></ItemStyle>
<HeaderStyle CssClass="clsLabel"></HeaderStyle>
<ItemTemplate>
<asp:Label ID="lblExclusionValue" Visible="True" Text='<%# DataBinder.Eval (Container.DataItem, "XPON_LIST_VALUE") %>'
runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle CssClass="RowStyle"></RowStyle>
<PagerStyle CssClass="PagerStyle"></PagerStyle>
</asp:GridView>
</asp:Panel>
</td>

 

Thanks in advance

:(kundan

 

EDIT: OMG...this needs a dash of CODE TAGS

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.