ASP.NET - GridView - Asked By Arun Tej on 08-May-12 06:24 AM

Earn up to 30 extra points for answering this tough question.
Hi,

   I have a large grid view in my application,when i scroll to last column the first column will be hide.But i want the first column should be freeze(show the first column) while i scrolling to last column also.

Thanks in advance,
M.Teja.
Arun Tej replied to Somesh Yadav on 09-May-12 05:59 AM
Thanks for the reply,

I got it using CSS but still there is a problem with this. Column was freezed  and working well while vertical scrolling but not getting when scrolls horizentally i.e the freezed column was fixed,when scrolls horizentally the freezed column was ideal but the corresponding columns were scrolled.I want to scroll the rows with freezed column.Please let me know any queries about the question.

Thanks in advance. 
dipa ahuja replied to Arun Tej on 09-May-12 07:54 AM

<style type="text/css">
  .WrapperDiv
  {
    width800px;
    height400px;
    border1px solid black;
  }
  
  .WrapperDiv TH
  {
    positionrelative;
  }
  
  .WrapperDiv TR
  {
    /* Needed for IE */
    height0px;
  }
</style>
<script>
  function onLoad() {
 
    FreezeGridViewHeader('GridView1''WrapperDiv');
  }
</script>

http://weblogs.asp.net/dwahlin/archive/2007/07/31/freeze-asp-net-gridview-headers-by-creating-client-side-extenders.aspx

 

Arun Tej replied to dipa ahuja on 10-May-12 01:21 AM
Thanks for the reply,

   but i did not get the solution,is there any need to add code to that column as i want
[)ia6l0 iii replied to Arun Tej on 10-May-12 12:56 PM
This cannot be done with simple css as suggested above. Mozilla based browsers wouldn't listen to the css code shown above. I have tried them over and over, and then moved to the jQuery FixedTable plugin. 

It is easy to integrate with the plugin, and have your first column freezed.  Instead of me repeating all the stuff that you have to do, please read the following post. This is from my bookmarks, and the plugin could have changed now from the time I bookmarked it. 

http://www.bluelemoncode.com/post/2011/12/30/Freezing-gridview-header-and-columns-while-scrolling-rest-of-the-content.aspx 

The jQuery FixedTable plugin can be downloaded from the following url.
http://www.novasoftware.com/Download/jQuery_FixedTable/jquery.fixedtable.js 

You can also see a demo at the following url.
http://www.novasoftware.com/Download/jQuery_FixedTable/jQuery_FixedTable_Demo.htm 

Nevertheless, the concept is easy to adhere to. 

Hope this helps.
Ramendra Kumar replied to Arun Tej on 16-May-12 07:19 AM
go to these two link , very useful, and let me know what happens
http://www.dotnetcurry.com/ShowArticle.aspx?ID=255
http://www.codeproject.com/Articles/30592/Freezing-ASP-NET-GridView-Header-With-JavaScript-a