Please help me i want to fix a column in grid view i used style for locking the
column since i am setting the position as relative its not working properly
i have given my code below could any body fix this issue
Expand|Select|Wrap|Line Numbers
- <style type="text/css">
- /* Div container to wrap the datagrid */
- div#div-datagrid
- {
- width: 700px;
- overflow-x: auto;
- overflow-y: hidden;
- overflow: -moz-scrollbars-vertical;
- scrollbar-base-color:#ffeaff;
- }
- /* Locks the left column */
- td.locked, th.locked {
- position:relative;
- cursor: default;
- /*IE5+ only*/
- left: expression(document.getElementById("div-datagrid").scrollLeft-2);
- }
- /* DataGrid Item and AlternatingItem Style*/
- .GridRow {font-size: 10pt; color: black; font-family: Arial;
- background-color:#ffffff; height:35px;}
- .GridAltRow {font-size: 10pt; color: black; font-family: Arial;
- background-color:#eeeeee; height:35px;}</PRE>
- </style>
- <html>
- <div id="div-datagrid" >
- <asp:GridView ID="GridView1" PagerSettings-Visible="false" runat="server" CellPadding="4" ForeColor="#333333"
- AllowSorting="True" AutoGenerateColumns="False" PageSize="7" AllowPaging="true"
- DataKeyNames="ClientId" OnRowDataBound="GridView1_RowDataBound" >
- <AlternatingRowStyle CssClass= "GridAltRow"/>
- <RowStyle CssClass= "GridRow"/>
- <Columns>
- <asp:BoundField DataField="ClientId" HeaderText="ClientId" InsertVisible="False"
- ReadOnly="True" SortExpression="ClientId" />
- <asp:BoundField DataField="EnterpriseUserName" />
- <column>
- </DataGrid>
- </Html>
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
e.Row.Cells[0].CssClass = "locked";
}
Is there is any other solution Please