Freezing few last rows, first few columns and header of grid View

Posted by Pmanik under ASP.NET on 12/4/2012 | Points: 10 | Views : 4057 | Status : [Member] | Replies : 0
Please suggest any workaround to freez the last 4 rows of my Grid View.

I have successfully freezed the header row and left 2 columns. And as per the requirement I need to freez the last 4 row also.
Below is the code summary
Html
--------
<div style="overflow:scroll; width:99%;height:250px" id="divDataGrid">
<asp:GridView ID="GridViewBalances" runat="server" AutoGenerateColumns="false" Width="100%" Height="120%" CssClass="scroll"
onrowdatabound="GridViewBalances_RowDataBound">
<Headerstyle cssClass = "frozenHeader" />
</asp:GridView>
</div>
CSS
------
.locked {
font-size: 14px;
font-weight: bold;
text-align: center;
background-color: White;
color:Black ;
border-right: 1px solid silver;
position:relative;
cursor: default;
/*IE5+ only*/
/*left: expression(document.getElementById("div-datagrid").scrollLeft-2);*/
/*left:expression((this.parentElement.parentElement.parentElement.parentElement.scrollLeft-2)+'px');*/

left: expression(document.getElementById("divDataGrid").scrollLeft-2);
}
.frozenHeader
{
font-size: 14px;
font-weight: bold;
text-align: center;
background-color: White;
color:Black ;
border-right: 1px solid black;
position:relative;
cursor: default;
top: expression(document.getElementById("divDataGrid").scrollTop-2);
z-index : 10;
}

Code Behind
-------------
RowDatabound event
e.Row.Cells[0].CssClass = "locked";
e.Row.Cells[1].CssClass = "locked";
e.Row.Cells[2].CssClass = "locked";
e.Row.Cells[3].CssClass = "locked";
e.Row.Cells[4].CssClass = "locked";




Responses

(No response found.)

Login to post response