473,396 Members | 2,139 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to freeze gridview in IE8

45
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 7836
NareshN
45
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 Expert Mod 8TB
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
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.dtd">
Feb 18 '11 #4

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

Similar topics

11
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...
3
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...
4
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...
5
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
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...
1
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)....
4
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....
1
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...
2
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
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.