Hmmmm, this type of question keeps popping up. Last time I checked, the "Excel type freeze" couldn't really be done. "Something like it" might be doable, though.
By javascript only, do you mean you want to apply javascript only to get the effect, or that you want the paging to be done without PostBack?
(In the latter case, the server will have the opportunity to format the page to make things easier for the javascript.)
Edit: Seems I need to check more often. Several of the links below here work nicely.
Superguppie.
Please remember to click “Mark as Answer” on the post that helps you. This can be beneficial to other community members reading the thread.
When all you've got is a Hammer, Every Problem looks like a Nail. Michael Swain.
this has some styling issue for large number of rows...due to which the horizontal alignment of rows is not consistent.... (not sure when i will get time to fix this)
hope this helps...
Cheers!
KK
Please mark as Answer if post helps in resolving your issue
My Site
jeeten09
Member
122 Points
150 Posts
Freeze Gridview Headers & First Column using Javascript...
Feb 24, 2012 10:18 AM|LINK
Hello All...
I want to freeze gridview Headers & first Column using Javascript only(must work Horizontally & Vertically)...
Can any1 please help me ???
Thank you in advance...
amit.jain
Star
11225 Points
1815 Posts
Re: Freeze Gridview Headers & First Column using Javascript...
Feb 24, 2012 10:20 AM|LINK
refer jQuery Fixed Header Scrollable GridView
Scrollable GridView With Fixed Headers In Asp.Net Using CSS
amiT jaiN
ASP.NET C# VB Articles And Code Examples
Muhammad Fak...
Contributor
2268 Points
511 Posts
Re: Freeze Gridview Headers & First Column using Javascript...
Feb 24, 2012 10:22 AM|LINK
Do you mean that you want the header and the first column to be freezed during the scrolling ?
If you feel it helps, Mark as answered so that it can help others to find solution.
For Any further questions, please contact me.
jeeten09
Member
122 Points
150 Posts
Re: Freeze Gridview Headers & First Column using Javascript...
Feb 24, 2012 10:23 AM|LINK
yes, & it must work both Horizantally & Vertically...
jeeten09
Member
122 Points
150 Posts
Re: Freeze Gridview Headers & First Column using Javascript...
Feb 24, 2012 10:26 AM|LINK
it is working only vertically bt i want it to work horizontally & vertically & also freeze first column...
Muhammad Fak...
Contributor
2268 Points
511 Posts
Re: Freeze Gridview Headers & First Column using Javascript...
Feb 24, 2012 10:39 AM|LINK
I think you can create a table with a header and first column fixed, and put the grid without the header and the first column and make it scrollable.
<table width="100%" border="1">
<tbody>
<tr>
<td>header1</td>
<td>header2</td>
</tr>
<tr>
<td>column1</td>
<td rowspan="10">
<table style="height: 10px; overflow: auto;" border="1">
<tbody>
<tr>
<td>data</td>
<td>data</td>
<td>data</td>
</tr>
<tr>
<td>data</td>
<td>data</td>
<td>data</td>
</tr>
<tr>
<td>data</td>
<td>data</td>
<td>data</td>
</tr>
<tr>
<td>data</td>
<td>data</td>
<td>data</td>
</tr>
<tr>
<td>data</td>
<td>data</td>
<td>data</td>
</tr>
<tr>
<td>data</td>
<td>data</td>
<td>data</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>column2</td>
</tr>
<tr>
<td>column2</td>
</tr>
<tr>
<td>column2</td>
</tr>
<tr>
<td>column2</td>
</tr>
<tr>
<td>column2</td>
</tr>
<tr>
<td>column2</td>
</tr>
<tr>
<td>column2</td>
</tr>
<tr>
<td>column2</td>
</tr>
<tr>
<td>column2</td>
</tr>
</tbody>
</table>
If you feel it helps, Mark as answered so that it can help others to find solution.
For Any further questions, please contact me.
superguppie
All-Star
48225 Points
8679 Posts
Re: Freeze Gridview Headers & First Column using Javascript...
Feb 27, 2012 09:41 AM|LINK
Hmmmm, this type of question keeps popping up. Last time I checked, the "Excel type freeze" couldn't really be done. "Something like it" might be doable, though.
By javascript only, do you mean you want to apply javascript only to get the effect, or that you want the paging to be done without PostBack?
(In the latter case, the server will have the opportunity to format the page to make things easier for the javascript.)
Edit: Seems I need to check more often. Several of the links below here work nicely.
Please remember to click “Mark as Answer” on the post that helps you. This can be beneficial to other community members reading the thread.
When all you've got is a Hammer, Every Problem looks like a Nail. Michael Swain.
kirupa.v
Contributor
2070 Points
531 Posts
Re: Freeze Gridview Headers & First Column using Javascript...
Feb 27, 2012 09:45 AM|LINK
Try the following URL
http://forums.asp.net/t/1028152.aspx
Hope it ll suite ur condition.
kedarrkulkar...
All-Star
34535 Points
5554 Posts
Re: Freeze Gridview Headers & First Column using Javascript...
Feb 27, 2012 09:51 AM|LINK
I have writen an article on the topic by using jQuery plugin....
http://www.bluelemoncode.com/post/2011/12/30/Freezing-gridview-header-and-columns-while-scrolling-rest-of-the-content.aspx
this has some styling issue for large number of rows...due to which the horizontal alignment of rows is not consistent.... (not sure when i will get time to fix this)
hope this helps...
KK
Please mark as Answer if post helps in resolving your issue
My Site
mudassarkhan
All-Star
78956 Points
13402 Posts
MVP
Re: Freeze Gridview Headers & First Column using Javascript...
Feb 27, 2012 09:51 AM|LINK
Refer here
http://www.aspsnippets.com/Articles/Scrollable-GridView-with-Fixed-Headers-using-jQuery-Plugin.aspx
http://www.aspsnippets.com/Articles/Dynamically-freeze-ASP.Net-Gridview-header-using-JavaScript.aspx
http://www.aspsnippets.com/Articles/Scrollable-GridView-with-Fixed-Headers-and-Client-Side-Sorting-using-jQuery-in-ASP.Net.aspx
Contact me