SHARE
TWEET

Untitled

a guest Jul 17th, 2017 33 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. protected void gvwProd_RowCreated(object sender, GridViewRowEventArgs e)
  2. {
  3.     if (e.Row.RowType == DataControlRowType.Header)
  4.     {
  5.         GridView gvw = (GridView)sender;
  6.  
  7.         GridViewRow HeaderRow = new GridViewRow(1, 1, DataControlRowType.Header, DataControlRowState.Insert);
  8.  
  9.         TableCell HeaderCell = new TableCell();
  10.         HeaderCell.Text = "Prod Comments - TS/LID";
  11.         HeaderCell.Style["font-weight"] = "bold";
  12.         HeaderCell.ColumnSpan = 4;
  13.         HeaderCell.Wrap = false;
  14.         HeaderRow.Cells.Add(HeaderCell);
  15.  
  16.         HeaderCell = new TableCell();
  17.         HeaderCell.Text = "Materials Comments - TS/LD";
  18.         HeaderCell.Style["font-weight"] = "bold";
  19.         HeaderCell.ColumnSpan = 8;
  20.         HeaderCell.Wrap = false;
  21.         HeaderRow.Cells.Add(HeaderCell);
  22.  
  23.         HeaderCell = new TableCell();
  24.         HeaderCell.Text = "Plant Comments - TS/LID";
  25.         HeaderCell.Style["font-weight"] = "bold";
  26.         HeaderCell.ColumnSpan = 11;
  27.         HeaderCell.Wrap = false;
  28.         HeaderRow.Cells.Add(HeaderCell);
  29.  
  30.         gvw.Controls[0].Controls.AddAt(1, HeaderRow);
  31.     }
  32. }
  33.    
  34. ((Table)gvw.Controls[0]).Rows.AddAt(1, HeaderRow);
RAW Paste Data
Top