Click here to Skip to main content
12,950,272 members (65,255 online)
Rate this:
 
Please Sign up or sign in to vote.
Hi everybody,
Is it possible to freeze a few columns of a gridview using only CSS. If yes, please help me with the way to do it. FYI, I have added the columns programatically using c# and the grid contains bound fields as well as template fields. This grid is implemented in sharepoint 2010. Please reply asap.

Thanks & Regards,
Srivikas.
Posted 15-Nov-12 0:05am
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

div#topdiv {
    position:fixed;
    top:0px;
    left:0px;
    width:100%;
    color:#CCC;
    background:#333;
    padding:8px;
}
div#bottomdiv {
    position:fixed;
    bottom:0px;
    left:0px;
    width:100%;
    color:#CCC;
    background:#333;
    padding:8px;
}
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 4

What actually you want friend, I mean collapsible and openable row in grid view or something else, if yes then it will be a bit difficult, I have faced the same problem before 5 months ago, and my lead advised me to use list view for achieving this functionality, and I did it using jQuery.
  Permalink  
Comments
Srivikas 15-Nov-12 12:23pm
   
Hi.. Thank u for your response. The grid I am going to use is very wide. i.e it has more number of columns. It is impossible to view all at a time in the window without scrolling. But the first two column are to be visible every time to understand the other details. SO i want to make them fixed and make the other columns scrollable.Have you got my point now? Waiting for your reply...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 5,829
CHill60 3,460
Maciej Los 2,953
Jochen Arndt 1,975
ppolymorphe 1,820


Advertise | Privacy | Mobile
Web01 | 2.8.170525.1 | Last Updated 15 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100