使标题文本中的rowpan以及实现的columnpan一起

时间:2019-03-17 14:05:59

标签: c# asp.net

我正在尝试使用rowspan 2做前两个标题。已经实现了Columnspan of 2。如何使这两个标头的行跨度为2?请参阅所附图片。

protected void StdGrid_DataBound(object sender, EventArgs e)
{

    StdGrid.Rows[0].Cells[0].RowSpan = 2; // not getting desired result
    GridViewRow row = new GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal);
    TableHeaderCell cell = new TableHeaderCell();
    cell.Text = "";
    cell.ColumnSpan = 2;

    row.Controls.Add(cell);
    cell = new TableHeaderCell();
    cell.ColumnSpan = 7;
    cell.Text = "MANAGEMENT";
    cell.BorderStyle = BorderStyle.Double;
    cell.HorizontalAlign = HorizontalAlign.Center;
}

前两列“ SN”和“ SYM NUM”的列跨度为2,如何在这两个标头中实现rowspanenter image description here

0 个答案:

没有答案