I am Using asp:datagrid, i want to fix the headers of datagrid my data grid code is as follows \[code\] <DIV id="Div1" style="OVERFLOW: auto; HEIGHT:550px;" runat="server"> <aspataGrid id="DGPKG" width="100%" runat="server" CellPadding="0" CellSpacing="1" BorderWidth="0px" CssClass="Background" AutoGenerateColumns="False" ShowFooter="True" type="printTable"> <HeaderStyle CssClass="FixedTableHeader"></HeaderStyle>\[/code\]my CSS of header is as follows \[code\].FixedTableHeader { background-color:#D67814; border-color: #D67814; position:relative; top:expression(this.offsetParent.scrollTop); }\[/code\]this works fine in all versions of IE (7,8,9) which is my requirement, the problem comes when i use rowspan in my datagrid the code snippet for creating the headers is as follows \[code\]private void DGPKG_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e){ if(e.Item.ItemType ==ListItemType.Header ) { e.Item.Visible=false; _qmService=new QMService(); DataGridItem dataGridItem = new DataGridItem ( 0, 0, ListItemType.Header ); dataGridItem.Cells.Add(_qmService.CreateTableCell("Sr No","C",0,2)); dataGridItem.Cells.Add(_qmService.CreateTableCell("Pkg No","C",0,2)); dataGridItem.Cells.Add(_qmService.CreateTableCell("Road","C",0,2)); dataGridItem.Cells.Add(_qmService.CreateTableCell("Maintenance","C",0,2)); dataGridItem.Cells.Add(_qmService.CreateTableCell("Total Maintenance","C",0,2)); dataGridItem.Cells.Add(_qmService.CreateTableCell("Start Date","C",0,2)); dataGridItem.Cells.Add(_qmService.CreateTableCell("Amount to be Paid","C",5,1)); dataGridItem.Cells.Add(_qmService.CreateTableCell("Status","C",0,2)); DGPKG.Controls[0].Controls.Add(dataGridItem); dataGridItem = new DataGridItem ( 0, 0, ListItemType.Header ); dataGridItem.Cells.Add(_qmService.CreateTableCell("Year1","C",0,1)); dataGridItem.Cells.Add(_qmService.CreateTableCell("Year2","C",0,1)); dataGridItem.Cells.Add(_qmService.CreateTableCell("Year3","C",0,1)); dataGridItem.Cells.Add(_qmService.CreateTableCell("Year4","C",0,1)); dataGridItem.Cells.Add(_qmService.CreateTableCell("Year5","C",0,1)); dataGridItem.Cells.Add(_qmService.CreateTableCell(" ","C",0,1)); DGPKG.Controls[0].Controls.Add(dataGridItem); }}\[/code\]_qmService.CreateTableCell("Year5","C",0,1) is simply a method to add a cell its definition is as follows_qmService.CreateTableCell(Column Name , Alignment ,Column Span ,Row Span ) the output when i apply CSS class is like this
the correct output must be like this
i am not getting what is wrong when i use rowspan ? if i dont use it, it works fine.thanks in advance