0
Answer

Freeze datagrid columns

hareesh kumar

hareesh kumar

14y
3.5k
1

Hi All,
I have to freeze the first column in a data grid.
i have done freezing part but the issue is vertical and horizontal scroll bar movement getting slow. in my data grid each row contains 18 textboxes and 18 image buttons.if number of rows count around 15 then the scroll bars working almost properly.issue in morethan 15 rows 
For freeze i am using CSS.Platform is asp.net1.1
in CSS i am using below given codes.
div#div-datagrid {
width: 200px;
height: 200px;
overflow: auto;
}
/* Locks the left column */
td.locked, th.locked {
position:relative;
cursor: default;
left: expression(document.getElementById("div-datagrid").scrollLeft-1);

/* Locks table header */
th {
font-size: 14px;
font-weight: bold;
text-align: center;
background-color:Navy;
color: white;
border-right: 1px solid silver;
position:relative;
cursor: default;
top: expression(document.getElementById("div-datagrid").scrollTop-4);
z-index: 10;
}
/* Keeps the header as the top most item. Important for top left item*/
th.locked {z-index: 99;}
if anybody have other code to resolve this issue.
regards
HareesH