473,549 Members | 2,846 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to freeze gridview in IE8

45 New Member
Hi All,

Can u tell me how to freeze gridview header and first column of each row in IE 8.

I am below code but it is not working for me.The same code is working fine in Sample which i am running in Same browser IE8.
Expand|Select|Wrap|Line Numbers
  1.  <style type="text/css">
  2.         /* Div container to wrap the datagrid */div#div-datagrid
  3.         {
  4.             width: 420px;
  5.             height: 200px;
  6.             overflow: auto;
  7.             scrollbar-base-color: #ffeaff;
  8.         }
  9.         /* Locks the left column */td.locked, th.locked
  10.         {
  11.             font-size: 14px;
  12.             font-weight: bold;
  13.             text-align: center;
  14.             background-color: navy;
  15.            color: white;
  16.             border-right: 1px solid silver;
  17.             position: relative;
  18.             cursor: default;
  19.             left: expression(document.getElementById(   "div-datagrid" ).scrollLeft-2); /*IE5+ only*/
  20.         }
  21.         /* Locks table header */th
  22.         {
  23.             font-size: 14px;
  24.             font-weight: bold;
  25.             text-align: center;
  26.             background-color: navy;
  27.             color: white;
  28.             border-right: 1px solid silver;
  29.             position: relative;
  30.             cursor: default;
  31.             top: expression(document.getElementById(   "div-datagrid" ).scrollTop-2); /*IE5+ only*/
  32.             z-index: 10;
  33.         }
  34.         /* Keeps the header as the top most item. Important for top left item*/th.locked
  35.         {
  36.             z-index: 99;
  37.         }
  38.         /* DataGrid Item and AlternatingItem Style*/.GridRow
  39.         {
  40.             font-size: 10pt;
  41.             color: black;
  42.             font-family: Arial;
  43.             background-color: #ffffff;
  44.             height: 35px;
  45.         }
  46.         .GridAltRow
  47.         {
  48.             font-size: 10pt;
  49.             color: black;
  50.             font-family: Arial;
  51.             background-color: #eeeeee;
  52.             height: 35px;
  53.         }
  54.     </style>
  55.  
  56.  
  57. <body>
  58.     <form id="form1" method="post" runat="server">
  59.     <div id="div-datagrid">
  60.         <asp:GridView ID="GridView1" runat="server" CssClass="Grid" UseAccessibleHeader="True"
  61.             OnRowDataBound="GridView1_RowDataBound1">
  62.         </asp:GridView>
  63.     </div>
  64.     </form>
  65. </body>
Feb 18 '11 #1
3 7845
NareshN
45 New Member
Hi All,

Thanks,

Its working now.

This is the problem <html xmlns="http://www.w3.org/1999/xhtml">
Feb 18 '11 #2
Frinavale
9,735 Recognized Expert Moderator Expert
How was <html xmlns="http://www.w3.org/1999/xhtml"> a problem?

What did you do to fix the problem?
Feb 18 '11 #3
NareshN
45 New Member
Hi,

Sorry this is the problem

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">


Earlier it was
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
Feb 18 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

11
2748
by: Timothy Shih | last post by:
Hi, I am having a freezing issue with my application. My application serves several remotable objects, all of which must be initialized before their use. Furthermore, some of them depend on each other. On my application startup, I configure the objects usting the RemotingConfiguration class to load the config file. Then I "ping" each of the...
3
3973
by: Joseph Gordon | last post by:
I need to "freeze" the headers for a webforms gridview. I have found no documentation or articles that explain how to accomplish this using the ASP.NET 2.0 GridView control. I really prefer not to have to add this functionality myself as I had to in the 1.1 framework, please tell me it's built-in. Thanks, -JGordon-
4
13838
by: Roger Withnell | last post by:
I would like to freeze column and row headings on a webpage, simulating freeze panes as in an Excel spreadsheet. Don't seem to be able to do it with Frames. Is there a way with Javascript and/or CSS and or Frames? Thanks in anticipation.
5
3785
by: Abhijeet Kumar | last post by:
Hi I am working with ASP.NET2.0, How can i freeze some of the columns of GridView Control. Thanks in Advance.
2
2094
by: NH | last post by:
Is it possible to create a gridview control that allows scrolling on the columns. I have a gridview with a list of people names in the first column and the rest of the columns are week dates just showing a certain value for each person for the week. My gridview currenntly shows 10 weeks. But can I fix the person column and allow scrolling...
1
3169
by: jmalone | last post by:
I have a python script that I need to freeze on AIX 5.1 (customer has AIX and does not want to install Python). The python script is pretty simple (the only things it imports are sys and socket). The README file in the Tools/freeze directory of the Python-2.4.4 distribution says the following (and many other things): Previous...
4
7018
by: ToxSox | last post by:
Hello. This is my first post here and i have a big problem with my script! One page (child.htm), was delivered not by me and i can't change it. This page calls a methode in a object of my page. I have opened the child.htm in a popup, so by opener.API the child.htm page can user the methodes which was defined in my API Obnject on...
1
1817
by: COHENMARVIN | last post by:
Is there any way to allow the user to see the titles of the columns of his gridview as he scrolls down the page? If I have a grid view with 50 rows, the top titles are no longer in view and its hard to tell what the numbers mean. Thanks, Marvin
2
3366
by: Seth Williams | last post by:
Is there a way to mimic the behavior in Excel, for a Gridview, to freeze the column headers/titles, so that they show, as you scroll down the gridview?
1
1515
by: jagsusa | last post by:
Hi I have a requirement where i want to freeze the 2 coloumns of the webpart(gridview).While scrolling the two fields shud remain as it is and other fields(say i have total of 10 then 8 should scroll and 2 should bre fixed/freezed) I tried with lots of css stuff which are avaialable in the net but no LUCK !! Please help . Quick response...
0
7518
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7715
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7956
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7469
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6040
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5087
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3480
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1057
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.