本文整理汇总了C#中TableHeaderCell类的典型用法代码示例。如果您正苦于以下问题:C# TableHeaderCell类的具体用法?C# TableHeaderCell怎么用?C# TableHeaderCell使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TableHeaderCell类属于命名空间,在下文中一共展示了TableHeaderCell类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GridView1_RowCreated
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
{
try
{
if (e.Row.RowType == DataControlRowType.Header)
{
GridView gv3 = sender as GridView;
GridViewRow row3 = new GridViewRow(0, -1, DataControlRowType.Header, DataControlRowState.Normal);
Table t3 = (Table)gv3.Controls[0];
TableCell FileDateb1 = new TableHeaderCell();
FileDateb1.Text = "<b>Center Name:</b> " + DropDownList4.SelectedItem.Text + " | <b>Course:</b> " + DropDownList2.SelectedItem.Text + " | <b> Period:</b> " + Convert.ToDateTime(TextBox1.Text).ToString("dd MMM, yyyy") + " to " + Convert.ToDateTime(TextBox2.Text).ToString("dd MMM, yyyy");
FileDateb1.ColumnSpan = GridView1.Columns.Count;
FileDateb1.Height = 50;
FileDateb1.Font.Size = 15;
FileDateb1.Font.Bold = true;
row3.Cells.Add(FileDateb1);
t3.Rows.AddAt(0, row3);
}
}
catch
{
}
}
示例2: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
if (Request.Params["SerialNum"] != null)
HyperLinkDetail.NavigateUrl = "../GameServer/ServerOperationHistory.aspx?SerialNum=" + Request.Params["SerialNum"].ToString();
TableHeaderRow header = new TableHeaderRow();
TableHeaderCell[] head = new TableHeaderCell[2];
for (int i = 0; i <= 1; i++) head[i] = new TableHeaderCell();
head[0].Width = new Unit(10f, UnitType.Percentage);
head[0].Text = StringDef.Name;
head[1].Width = new Unit(30f, UnitType.Percentage);
head[1].Text = StringDef.Message;
header.Cells.AddRange(head);
ResultList.Rows.Add(header);
if (Session["ActionResultList"] == null)
{
TableRow row = new TableRow();
TableCell[] cell = new TableCell[2];
for (int i = 0; i <= 1; i++) cell[i] = new TableCell(); ;
cell[0].Text = "";
cell[1].Text = "Çë²é¿´ÈÕÖ¾";
row.Cells.AddRange(cell);
ResultList.Rows.Add(row);
}
else
{
ShowRunResult(Session["ActionResultList"] as IList);
}
}
}
示例3: GridView1_DataBound
protected void GridView1_DataBound(object sender, EventArgs e)
{
if (GridView1.Rows.Count > 0)
{
Table tbl = (Table)GridView1.Controls[0];
GridViewRow row = new GridViewRow(1, -1, DataControlRowType.Header, DataControlRowState.Normal);
string msg = " ";
if (rsQty == limitQty)
msg = "Warning: Your search result has reached the limit of the number of " + limitQty.ToString();
TableCell th = new TableHeaderCell();
th.ColumnSpan = 6;
th.Text = msg;
row.Cells.Add(th);
TableCell thQty = new TableHeaderCell();
thQty.Text = "Total Qty<br/>" + totalQty.ToString();
thQty.ForeColor = System.Drawing.Color.Red;
thQty.HorizontalAlign = HorizontalAlign.Right;
row.Cells.Add(thQty);
TableCell thAmt = new TableHeaderCell();
thAmt.Text = "Total Amount<br/>" + totalAmt.ToString();
row.Cells.Add(thAmt);
thAmt.ForeColor = System.Drawing.Color.Red;
thAmt.HorizontalAlign = HorizontalAlign.Right;
TableCell th2 = new TableHeaderCell();
th2.ColumnSpan = 8;
th2.Text = " ";
row.Cells.Add(th2);
tbl.Rows.AddAt(1, row);
}
}
示例4: DropDownListSuppliers_SelectedIndexChanged
protected void DropDownListSuppliers_SelectedIndexChanged(object sender, EventArgs e)
{
if (DropDownListSuppliers.SelectedIndex == 0) return;
List<List<string>> lProd = NorthwindAccess.GetProducts(DropDownListSuppliers.SelectedValue);
TableHeaderRow thr = new TableHeaderRow();
for (int i = 0; i < lProd[0].Count; i++)
{
TableHeaderCell thc = new TableHeaderCell();
thc.Text = lProd[0][i];
thr.Cells.Add(thc);
}
tableProducts.Rows.Add(thr);
for (int i = 1; i < lProd.Count; i++)
{
TableRow tr = new TableRow();
for (int ii = 0; ii < lProd[i].Count; ii++)
{
TableCell tc = new TableCell();
tc.Text = lProd[i][ii];
tr.Cells.Add(tc);
}
tableProducts.Rows.Add(tr);
}
}
示例5: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
v1txtName.Focus();
//count is used to populate the number of rows in the view2 table
//it is based on the number entered in the v1txtFields TextBox
int count;
try
{
if (v1txtFields.Text.Trim().Length > 0)//if a value is present at all
{
count = int.Parse(v1txtFields.Text.Trim());//get the number from v1txtFields TextBox
//set the table columns and headers
TableHeaderRow thr = new TableHeaderRow();
TableHeaderCell thFieldName = new TableHeaderCell();
TableHeaderCell thDataType = new TableHeaderCell();
TableHeaderCell thRequired = new TableHeaderCell();
thFieldName.Text = "Field Name";
thDataType.Text = "Data Type";
thRequired.Text = "Required";
thr.Cells.Add(thFieldName);
thr.Cells.Add(thDataType);
thr.Cells.Add(thRequired);
v2table.Rows.Add(thr);
//populate the table with new text boxes, drop lists, and validators
for (int i = 0; i < count; i++)
{
TableRow tr = new TableRow();
TableCell c1 = new TableCell();//text box
TableCell c2 = new TableCell();//droplist
TableCell c3 = new TableCell();//checkbox
DropDownList ddl = SetDataTypeList();
TextBox t = new TextBox();
t.TabIndex = (short)(i + 1);
t.ID = "box" + i.ToString(); // can't validate without an ID
c1.Controls.Add(t);
c2.Controls.Add(ddl);
c3.Controls.Add(new CheckBox());
tr.Cells.Add(c1);
tr.Cells.Add(c2);
tr.Cells.Add(c3);
tr.Cells.Add(new TableCell()); //add a blank cell for the validator later
v2table.Rows.Add(tr);
}
}
else //nothing is in the view 1 textbox at page load
{
count = 0;
}
}
catch (Exception)
{
}
}
示例6: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
Alert.Visible = false;
LoadAllStandardOperatingProcedures();
if (standardOperatingProcedures == null)
{
Alert.Visible = true;
Alert.InnerHtml = "There are no SOPs in the database!";
}
else
{
var headerRow = new TableHeaderRow();
var titleHeaderCell = new TableHeaderCell();
titleHeaderCell.Text = "Title";
var departmentHeaderCell = new TableHeaderCell();
departmentHeaderCell.Text = "Department";
TableHeaderCell[] headerCells = { titleHeaderCell, departmentHeaderCell };
headerRow.Cells.AddRange(headerCells);
StandardOperatingProcedures.Rows.Add(headerRow);
foreach (var sop in standardOperatingProcedures)
{
var row = new TableRow();
var titleCell = new TableCell();
titleCell.Text = sop.Title;
var departmentCell = new TableCell();
departmentCell.Text = sop.Department;
//var previewCell = new TableCell();
//previewCell.Text = "<a href='"
var viewCell = new TableCell();
var viewButton = new Button();
viewButton.Text = "View";
viewButton.CommandArgument = sop.Title;
viewButton.Command += new CommandEventHandler(ViewClick);
viewCell.Controls.Add(viewButton);
var downloadCell = new TableCell();
Button downloadButton = new Button();
downloadButton.Text = "Download";
downloadButton.CommandArgument = sop.Title;
downloadButton.Command += new CommandEventHandler(DownloadClick);
downloadCell.Controls.Add(downloadButton);
var editCell = new TableCell();
Button editButton = new Button();
editButton.Text = "Edit";
editButton.CommandArgument = sop.XmlPath.Substring(sop.XmlPath.LastIndexOf('\\'));
editButton.Command += new CommandEventHandler(EditClick);
editCell.Controls.Add(editButton);
TableCell[] cells = { titleCell, departmentCell, viewCell, /*previewCell,*/ downloadCell, editCell };
row.Cells.AddRange(cells);
StandardOperatingProcedures.Rows.Add(row);
}
}
}
示例7: GridView1_RowCreated
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header)
{
GridView gv = sender as GridView;
GridViewRow row = new GridViewRow(0, -1, DataControlRowType.Header, DataControlRowState.Normal);
Table t = (Table)gv.Controls[0];
TableCell cell1 = new TableHeaderCell();
cell1.Text = "S. No";
row.Cells.Add(cell1);
TableCell cell2 = new TableHeaderCell();
cell2.Text = "S. No. of Auction List";
row.Cells.Add(cell2);
TableCell cell3 = new TableHeaderCell();
cell3.Text = "Bid Paper No.";
row.Cells.Add(cell3);
TableCell cell4 = new TableHeaderCell();
cell4.Text = "Name of Purchaser";
row.Cells.Add(cell4);
TableCell cell5 = new TableHeaderCell();
cell5.Text = "Lot No. Purchased";
row.Cells.Add(cell5);
TableCell cell6 = new TableHeaderCell();
cell6.Text = "Stack No. Purchased";
row.Cells.Add(cell6);
TableCell cell7 = new TableHeaderCell();
cell7.Text = "Species";
row.Cells.Add(cell7);
TableCell cell8 = new TableHeaderCell();
cell8.Text = "Sizes";
row.Cells.Add(cell8);
TableCell cell9 = new TableHeaderCell();
cell9.Text = "No.";
row.Cells.Add(cell9);
t.Rows.AddAt(0, row);
Table t8 = (Table)gv.Controls[0];
}
}
示例8: btnFindParticipants_Click
/// <summary>
/// Event triggered to perform the matchmaking algorithm
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnFindParticipants_Click(object sender, EventArgs e)
{
int studyID = Convert.ToInt32(Request.QueryString["study_id"]);
Matchmaker matchmaker = new Matchmaker(new Study(studyID));
Table tblResults = new Table();
TableHeaderRow header = new TableHeaderRow();
TableHeaderCell headerName = new TableHeaderCell();
TableHeaderCell headerEmail = new TableHeaderCell();
TableHeaderCell headerScore = new TableHeaderCell();
headerName.Text = "Name";
headerEmail.Text = "Email";
headerScore.Text = "Score";
header.Cells.Add(headerName);
header.Cells.Add(headerEmail);
header.Cells.Add(headerScore);
tblResults.Rows.Add(header);
tblResults.CellSpacing = 3;
tblResults.CellPadding = 5;
foreach (KeyValuePair<Participant, int> result in matchmaker.Results) {
TableRow row = new TableRow();
TableCell cellID = new TableCell();
TableCell cellName = new TableCell();
TableCell cellEmail = new TableCell();
TableCell cellScore = new TableCell();
cellID.Text = result.Key.UserID.ToString();
cellID.Visible = false;
HyperLink link = new HyperLink();
link.ToolTip = "Click the link to view more information about this user";
link.Text = result.Key.FirstName + " " + result.Key.LastName;
link.NavigateUrl="ParticipantInfo.aspx?participant_id=" + cellID.Text + "&study_id=" + studyID;
cellName.Controls.Add(link);
cellEmail.Text = result.Key.Email;
cellScore.Text = result.Value.ToString();
row.Cells.Add(cellID);
row.Cells.Add(cellName);
row.Cells.Add(cellEmail);
row.Cells.Add(cellScore);
tblResults.Rows.AddAt(getIndexToAdd(tblResults, row), row);
pnlmatchmakingResults.Controls.Add(tblResults);
}
if (matchmaker.Results.Count == 0) {
lblNoResults.Visible = true;
}
pnlmatchmakingResults.Visible = true;
btnEmailParticipant.Visible = true;
}
示例9: ShowState
private void ShowState(AccountState state)
{
TableRow row = new TableRow();
TableHeaderCell cell = new TableHeaderCell();
cell.Width = new Unit(30, UnitType.Percentage);
cell.Text = StringDef.AccountState;
row.Cells.Add(cell);
TableCell cell1 = new TableCell();
cell1.Text = state.ToString();
row.Cells.Add(cell1);
TableResult.Rows.Add(row);
}
示例10: fillTable
public void fillTable(string sql, ref Table table)
{
DataTable dataTable = selectQuery(sql);
TableHeaderRow th = new TableHeaderRow();
for (int i = 0; i < dataTable.Columns.Count; i++)
{
TableHeaderCell cell = new TableHeaderCell();
cell.Text = dataTable.Columns[i].ColumnName;
th.Cells.Add(cell);
}
table.Rows.Add(th);
foreach (DataRow row in dataTable.Rows)
{
TableRow trow = new TableRow();
for (int i = 0; i < dataTable.Columns.Count; i++)
{
TableCell cell = new TableCell();
cell.Text = row[i].ToString();
trow.Cells.Add(cell);
}
if (table.ID == "TableEquip")
{
TableCell cell = new TableCell();
LinkButton edit = new LinkButton();
edit.PostBackUrl = "~/PersonnelEditEquip.aspx?equip=";
edit.PostBackUrl += row[0].ToString();
edit.Text = "ویرایش";
cell.Controls.Add(edit);
trow.Cells.Add(cell);
}
table.Rows.Add(trow);
}
}
示例11: ShowGatewayList
private void ShowGatewayList(IList<GatewayInfo> list)
{
if (list == null || list.Count == 0)
{
return;
}
TableHeaderRow rowHead = new TableHeaderRow();
TableHeaderCell cellHead = new TableHeaderCell();
cellHead.Text = StringDef.GatewayName;
rowHead.Cells.Add(cellHead);
cellHead = new TableHeaderCell();
cellHead.Text = StringDef.ZoneName;
rowHead.Cells.Add(cellHead);
cellHead = new TableHeaderCell();
cellHead.Text = StringDef.IPAddress;
rowHead.Cells.Add(cellHead);
TableGatewayInfo.Rows.Add(rowHead);
foreach (GatewayInfo info in list)
{
TableRow row = new TableRow();
TableCell cell = new TableCell();
cell.Text = info.GatewayName;
row.Cells.Add(cell);
cell = new TableCell();
cell.Text = info.ZoneName;
row.Cells.Add(cell);
cell = new TableCell();
cell.Text = info.IPAddress;
row.Cells.Add(cell);
TableGatewayInfo.Rows.Add(row);
}
LabelResult.Text = StringDef.GatewayList;
}
示例12: CreateHeader
public static void CreateHeader(string strheader, Table table, int[] widths)
{
string[] Headers = strheader.Split(',');
TableHeaderRow thr = new TableHeaderRow();
int i = 0;
if (Headers.Length != widths.Length)
{
i = -1;
}
foreach (string s in Headers)
{
TableHeaderCell tc = new TableHeaderCell();
tc.Text = s;
if (i > -1)
{
tc.Width = widths[i];
i++;
}
thr.Cells.Add(tc);
}
table.Rows.Add(thr);
}
示例13: GridView2_RowCreated
protected void GridView2_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header)
{
GridView gv3 = sender as GridView;
GridViewRow row3 = new GridViewRow(0, -1, DataControlRowType.Header, DataControlRowState.Normal);
Table t3 = (Table)gv3.Controls[0];
// Adding Cells
TableCell FileDateb2 = new TableHeaderCell();
FileDateb2.Text = "";
row3.Cells.Add(FileDateb2);
TableCell FileDateb3 = new TableHeaderCell();
FileDateb3.Text = "Per Piece";
row3.Cells.Add(FileDateb3);
TableCell FileDateb4 = new TableHeaderCell();
FileDateb4.Text = "Per M3";
row3.Cells.Add(FileDateb4);
TableCell FileDateb5 = new TableHeaderCell();
FileDateb5.Text = "";
row3.Cells.Add(FileDateb5);
TableCell FileDateb6 = new TableHeaderCell();
FileDateb6.Text = "Per Piece";
row3.Cells.Add(FileDateb6);
TableCell FileDateb7 = new TableHeaderCell();
FileDateb7.Text = "Per M3";
row3.Cells.Add(FileDateb7);
TableCell FileDateb8 = new TableHeaderCell();
FileDateb8.Text = "";
row3.Cells.Add(FileDateb8);
TableCell FileDateb9 = new TableHeaderCell();
FileDateb9.Text = "Amt.";
row3.Cells.Add(FileDateb9);
TableCell FileDateb11 = new TableHeaderCell();
FileDateb11.Text = "%";
row3.Cells.Add(FileDateb11);
t3.Rows.AddAt(0, row3);
GridView gv = sender as GridView;
GridViewRow row = new GridViewRow(0, -1, DataControlRowType.Header, DataControlRowState.Normal);
Table t = (Table)gv.Controls[0];
TableCell cell1 = new TableHeaderCell();
cell1.Text = "Vol. M3";
row.Cells.Add(cell1);
TableCell cell2 = new TableHeaderCell();
cell2.Text = "Rate Obtained Per Piece/Per M3";
cell2.ColumnSpan = 2;
row.Cells.Add(cell2);
TableCell cell3 = new TableHeaderCell();
cell3.Text = "Sale/Bid Ammount";
row.Cells.Add(cell3);
TableCell cell4 = new TableHeaderCell();
cell4.ColumnSpan = 2;
cell4.Text = "Floor Rate Per M3";
row.Cells.Add(cell4);
TableCell cell5 = new TableHeaderCell();
cell5.Text = "Ammount";
row.Cells.Add(cell5);
TableCell cell6 = new TableHeaderCell();
cell6.Text = "Variations (+/-)%";
cell6.ColumnSpan = 2;
row.Cells.Add(cell6);
t.Rows.AddAt(0, row);
Table t8 = (Table)gv.Controls[0];
}
}
示例14: CreateMatrix
/// <summary>
/// Generates the permission matrix for the cutrrent project.
/// </summary>
private void CreateMatrix()
{
// Get project resource info
if (resProjects == null)
{
resProjects = ResourceInfoProvider.GetResourceInfo("CMS.ProjectManagement");
}
// Get project object
if ((project == null) && (ProjectID > 0))
{
project = ProjectInfoProvider.GetProjectInfo(ProjectID);
}
if ((resProjects != null) && (project != null))
{
// Get permissions for the current project resource
DataSet permissions = PermissionNameInfoProvider.GetResourcePermissions(resProjects.ResourceId);
if (DataHelper.DataSourceIsEmpty(permissions))
{
lblInfo.Text = GetString("general.emptymatrix");
}
else
{
TableRow headerRow = new TableRow();
headerRow.CssClass = "UniGridHead";
TableCell newCell = new TableCell();
TableHeaderCell newHeaderCell = new TableHeaderCell();
newHeaderCell.Text = " ";
newHeaderCell.Attributes["style"] = "width:200px;";
headerRow.Cells.Add(newHeaderCell);
foreach (string permission in allowedPermissions)
{
DataRow[] drArray = permissions.Tables[0].DefaultView.Table.Select("PermissionName = '" + permission + "'");
if ((drArray != null) && (drArray.Length > 0))
{
DataRow dr = drArray[0];
newHeaderCell = new TableHeaderCell();
newHeaderCell.Attributes["style"] = "text-align:center;white-space:nowrap;";
newHeaderCell.Text = dr["PermissionDisplayName"].ToString();
newHeaderCell.ToolTip = dr["PermissionDescription"].ToString();
newHeaderCell.HorizontalAlign = HorizontalAlign.Center;
headerRow.Cells.Add(newHeaderCell);
}
else
{
throw new Exception("[Security matrix] Column '" + permission + "' cannot be found.");
}
}
newHeaderCell = new TableHeaderCell();
newHeaderCell.Text = " ";
headerRow.Cells.Add(newHeaderCell);
tblMatrix.Rows.Add(headerRow);
// Render project access permissions
object[,] accessNames = new object[5,2];
accessNames[0, 0] = GetString("security.nobody");
accessNames[0, 1] = SecurityAccessEnum.Nobody;
accessNames[1, 0] = GetString("security.allusers");
accessNames[1, 1] = SecurityAccessEnum.AllUsers;
accessNames[2, 0] = GetString("security.authenticated");
accessNames[2, 1] = SecurityAccessEnum.AuthenticatedUsers;
accessNames[3, 0] = GetString("security.groupmembers");
accessNames[3, 1] = SecurityAccessEnum.GroupMembers;
accessNames[4, 0] = GetString("security.authorizedroles");
accessNames[4, 1] = SecurityAccessEnum.AuthorizedRoles;
TableRow newRow = null;
int rowIndex = 0;
for (int access = 0; access <= accessNames.GetUpperBound(0); access++)
{
SecurityAccessEnum currentAccess = ((SecurityAccessEnum)accessNames[access, 1]);
// If the security isn't displayed as part of group section
if ((currentAccess == SecurityAccessEnum.GroupMembers) && (project.ProjectGroupID == 0))
{
// Do not render this access item
}
else
{
// Generate cell holding access item name
newRow = new TableRow();
newRow.CssClass = ((rowIndex % 2 == 0) ? "EvenRow" : "OddRow");
newCell = new TableCell();
newCell.Text = accessNames[access, 0].ToString();
newCell.Wrap = false;
newCell.CssClass = "MatrixHeader";
newCell.Width = new Unit(28, UnitType.Percentage);
newRow.Cells.Add(newCell);
rowIndex++;
// Render the permissions access items
bool isAllowed = false;
bool isDisabled = (!Enable);
int permissionIndex = 0;
//.........这里部分代码省略.........
示例15: GenerateMatrixHeader
/// <summary>
/// Generate header of the matrix.
/// </summary>
/// <param name="matrixData">Data of the matrix to be generated</param>
private void GenerateMatrixHeader(List<DataRow> matrixData)
{
// Prepare matrix header
foreach (int index in ColumnOrderIndex)
{
DataRow dr = matrixData[index];
if (ShowHeaderRow)
{
// Create header cell
var thc = new TableHeaderCell
{
Scope = TableHeaderScope.Column,
Text = HTMLHelper.HTMLEncode(MacroResolver.Resolve(Convert.ToString(dr[ColumnItemDisplayNameColumn]))),
ToolTip = (ColumnItemTooltipColumn != null) ? GetTooltip(dr, ItemTooltipColumn) : null,
EnableViewState = false
};
thrFirstRow.Cells.Add(thc);
// Add disabled mark if needed
if (!IsColumnEditable(dr[ColumnItemIDColumn]))
{
thc.Text += DisabledColumnMark;
}
}
else
{
// Create header cell
var thc = new TableHeaderCell
{
Scope = TableHeaderScope.Column,
Text = " ",
EnableViewState = false
};
thrFirstRow.Cells.Add(thc);
}
}
}