C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » ASP.NET/Web Applications »

Freezing GridView Column Headers


Posted Date: 22 Sep 2007    Resource Type: Articles    Category: ASP.NET/Web Applications
Author: KamalMember Level: Gold    
Rating: 1 out of 5Points: 13



For Freezing GridView Header column

Put GridView in Panel or Div Tag.

< asp:Panel ID="Panel1" runat="server" class="freez" style="height:300px; width:700px;" >

< asp:GridView ID="GridView1" runat="server" AllowPaging="False" AllowSorting="True"
AutoGenerateColumns="False" DataKeyNames="id" DataSourceID="SqlDataSource1" Width="700px" BorderWidth="0" >
< Columns >
< asp:BoundField DataField="id" HeaderText="ID" SortExpression="id" / >
< / Columns >

</asp:Panel>

Next create freez Css Class

Next, I created the container css style class as Mitch suggests ...

/* So the overflow scrolls */
.freez {overflow:auto;}

/* Keep the header cells positioned as we scroll */
.freez table th {position:relative;}

/* For alignment of the scroll bar */
.freez table tbody {overflow-x:hidden;}

But,Problem is that it work fine in IE but not in FireFox.



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Properties In User Controls - A Tip And Trick
Previous Resource: Jupload -- A review on elegant uploading
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET/Web Applications


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use