Helloa ll,
Colspan not working as expected in Chrome using C# ASP.NET
The problem is, the colspanattribute works fine in internet explorer (surprise surprise), however, in Chrome, all the content which is supposed to be spread over the columns, only goes into the 1st column.
I have this code:
protected void gvProducts_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header)
{
GridViewRow HeaderRow = new GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Insert);
TableCell HeaderCell = new TableCell();
HeaderCell.Text = "";
HeaderCell.ColumnSpan = 4;
HeaderRow.Cells.Add(HeaderCell);
HeaderCell = new TableCell();
HeaderCell.Text = "661";
HeaderCell.ColumnSpan = 2;
HeaderRow.Cells.Add(HeaderCell);
TableCell HeaderCell1 = new TableCell();
HeaderCell1 = new TableCell();
HeaderCell1.Text = "662";
HeaderCell1.ColumnSpan = 2;
HeaderRow.Cells.Add(HeaderCell1);
TableCell HeaderCell2 = new TableCell();
HeaderCell2 = new TableCell();
HeaderCell2.Text = "663";
HeaderCell2.ColumnSpan = 2;
HeaderRow.Cells.Add(HeaderCell2);
TableCell HeaderCell3 = new TableCell();
HeaderCell3 = new TableCell();
HeaderCell3.Text = "664";
HeaderCell3.ColumnSpan = 2;
HeaderRow.Cells.Add(HeaderCell3);
TableCell HeaderCell4 = new TableCell();
HeaderCell4 = new TableCell();
HeaderCell4.Text = "665";
HeaderCell4.ColumnSpan = 2;
HeaderRow.Cells.Add(HeaderCell4);
TableCell HeaderCell5 = new TableCell();
HeaderCell5 = new TableCell();
HeaderCell5.Text = "669";
HeaderCell5.ColumnSpan = 2;
HeaderRow.Cells.Add(HeaderCell5);
TableCell HeaderCell6 = new TableCell();
HeaderCell6 = new TableCell();
HeaderCell6.Text = "667";
HeaderCell6.ColumnSpan = 2;
HeaderRow.Cells.Add(HeaderCell6);
TableCell HeaderCell7 = new TableCell();
HeaderCell7.Text = "THE OTHERS";
HeaderCell7.ColumnSpan = 2;
HeaderRow.Cells.Add(HeaderCell7);
TableCell HeaderCell8 = new TableCell();
HeaderCell8.Text = "END";
HeaderCell8.ColumnSpan = 2;
HeaderRow.Cells.Add(HeaderCell8);
TableCell HeaderCell9 = new TableCell();
HeaderCell9.Text = "";
HeaderCell9.ColumnSpan = 2;
HeaderRow.Cells.Add(HeaderCell9);
HeaderRow.Attributes.Add("class", "labelStyle");
gvProducts.Controls[0].Controls.AddAt(0, HeaderRow);
}
}
Any ideas how to fix this?