Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.