本文整理汇总了C#中System.Web.UI.HtmlControls.HtmlTableRow类的典型用法代码示例。如果您正苦于以下问题:C# HtmlTableRow类的具体用法?C# HtmlTableRow怎么用?C# HtmlTableRow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HtmlTableRow类属于System.Web.UI.HtmlControls命名空间,在下文中一共展示了HtmlTableRow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
HtmlTable table1 = new HtmlTable();
table1.Border = 1;
table1.CellPadding = 3;
table1.CellSpacing = 3;
table1.BorderColor = "red";
HtmlTableRow row;
HtmlTableCell cell;
for (int i = 1; i <= 5; i++)
{
row = new HtmlTableRow();
row.BgColor = (i % 2 == 0 ? "lightyellow" : "lightcyan");
for (int j = 1; j <= 4; j++)
{
cell = new HtmlTableCell();
cell.InnerHtml = "Row: " + i.ToString() + "<br /> Cell: " + j.ToString();
row.Cells.Add(cell);
}
table1.Rows.Add(row);
}
this.Controls.Add(table1);
}
示例2: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
//tabelaZlecenia.Rows.Clear();
DataView view = (DataView)SqlDataZleceniodawcy.Select(DataSourceSelectArguments.Empty);
DataTable table = view.ToTable();
DataSet ds = new DataSet();
ds.Tables.Add(table);
foreach (DataRow row in ds.Tables[0].Rows)
{
HtmlTableRow htmlrow = new HtmlTableRow();
HtmlTableCell htmlcell = new HtmlTableCell();
HtmlTableCell htmlcell2 = new HtmlTableCell();
HtmlTableCell htmlcell3 = new HtmlTableCell();
HtmlTableCell htmlcell4 = new HtmlTableCell();
HtmlTableCell htmlcell5 = new HtmlTableCell();
htmlcell.InnerText = row["Imie"].ToString() + " " + row["Nazwisko"].ToString();
htmlrow.Cells.Add(htmlcell);
htmlcell2.InnerText = row["NazwaFirmy"].ToString();
htmlrow.Cells.Add(htmlcell2);
htmlcell3.InnerText = row["email"].ToString();
htmlrow.Cells.Add(htmlcell3);
htmlcell4.InnerText = row["Telefon"].ToString();
htmlrow.Cells.Add(htmlcell4);
htmlcell5.InnerText = row["NIP"].ToString();
htmlrow.Cells.Add(htmlcell5);
tabelaZleceniodawcy.Rows.Add(htmlrow);
tabelaZleceniodawcy.DataBind();
}
}
示例3: LoadWeights
private void LoadWeights()
{
ConnectorDataContext db = new ConnectorDataContext();
Stopwatch w = Stopwatch.StartNew();
List<FeatureScore> fScores = db.FeatureScores.ToList();
w.Stop();
ILog log = LogManager.GetLogger("QueryLogger");
log.Info(" Elapsed time: " + w.Elapsed + ", select all feature scores");
foreach (var item in fScores)
{
HtmlTableCell service = new HtmlTableCell();
HtmlTableCell feature = new HtmlTableCell();
HtmlTableCell weight = new HtmlTableCell();
service.InnerText = item.ServiceInstance.name;
feature.InnerText = item.feature;
weight.InnerText = item.score.ToString();
weight.Attributes.Add("class", "center");
weight.Attributes.Add("contenteditable", "true");
HtmlTableRow tr = new HtmlTableRow();
tr.Cells.Add(service);
tr.Cells.Add(feature);
tr.Cells.Add(weight);
WeightTable.Rows.Add(tr);
}
}
示例4: AddTo
public override Control AddTo(Control container)
{
HtmlTableCell labelCell = new HtmlTableCell();
Label label = AddLabel(labelCell);
HtmlTableCell editorCell = new HtmlTableCell();
Control editor = AddEditor(editorCell);
if (label != null && editor != null && !string.IsNullOrEmpty(editor.ID))
label.AssociatedControlID = editor.ID;
HtmlTableCell extraCell = new HtmlTableCell();
if (Required)
AddRequiredFieldValidator(extraCell, editor);
if (Validate)
AddRegularExpressionValidator(extraCell, editor);
AddHelp(extraCell);
HtmlTableRow row = new HtmlTableRow();
row.Cells.Add(labelCell);
row.Cells.Add(editorCell);
row.Cells.Add(extraCell);
HtmlTable editorTable = new HtmlTable();
editorTable.Attributes["class"] = "editDetail";
editorTable.Controls.Add(row);
container.Controls.Add(editorTable);
return editor;
}
示例5: BindUserGorupMaxspacephotosize
private void BindUserGorupMaxspacephotosize()
{
#region 绑定用户组照片空间大小
DataTable dt = DatabaseProvider.GetInstance().GetUserGroupMaxspacephotosize();
int i = 1;
HtmlTableRow tr = new HtmlTableRow();
foreach (DataRow dr in dt.Rows)
{
if (i % 2 == 1)
{
tr = new HtmlTableRow();
}
HtmlTableCell td = new HtmlTableCell("td");
td.Controls.Add(new LiteralControl(dr["grouptitle"].ToString()));
tr.Cells.Add(td);
td = new HtmlTableCell("td");
Discuz.Control.TextBox tb = new Discuz.Control.TextBox();
tb.ID = "maxspacephotosize" + dr["groupid"].ToString();
tb.Size = 10;
tb.MaxLength = 9;
tb.Text = dr["maxspacephotosize"].ToString();
tb.RequiredFieldType = "数据校验";
td.Controls.Add(tb);
tr.Cells.Add(td);
tr.Cells.Add(GetTD("maxspacephotosize" + dr["groupid"].ToString()));
groupphotosize.Rows.Add(tr);
i++;
}
#endregion
}
示例6: RefreshCheckpointList
private void RefreshCheckpointList()
{
CheckpointsTable.Rows.Clear();
HtmlTableRow tr = new HtmlTableRow();
foreach (JobCheckpoint cp in checkpoints)
{
HtmlTableCell value = new HtmlTableCell();
value.InnerText = cp.Name;
switch (cp.ExecutionStatus)
{
case JobExecutionState.Unknown:
case JobExecutionState.Scheduled:
value.Attributes.Add("class", "Checkpoint");
break;
default:
value.Attributes.Add("class", "Checkpoint Checkpoint" + cp.ExecutionStatus.ToString());
break;
}
tr.Cells.Add(value);
}
CheckpointsTable.Rows.Add(tr);
}
示例7: Test
private void Test()
{
string _discountName = "asdfghij";
//row.Where(r => r.Cells.Any(c => c.InnerText.Contains(discountName)));
List<HtmlTableRow> _discountTable = new List<HtmlTableRow>();
for (int _row = 0; _row < 2; _row++)
{
HtmlTableRow _newRow = new HtmlTableRow();
for (int _cells = 0; _cells < 5; _cells++)
{
HtmlTableCell _cell = new HtmlTableCell();
_cell.InnerText = "Cell" + _cells.ToString();
_newRow.Cells.Add(_cell);
}
_discountTable.Add(_newRow);
}
List<HtmlTableRow> _resultRows = new List<HtmlTableRow>();
foreach (HtmlTableRow _htmlTableRow in _discountTable)
{
if (_htmlTableRow.Cells.Cast<HtmlTableCell>().Any(_cell => _cell.InnerText.Contains(_discountName)))
{
_resultRows.Add(_htmlTableRow);
}
}
}
示例8: AddTopFormControls
private void AddTopFormControls(HtmlTable table)
{
using (HtmlTableRow row = new HtmlTableRow())
{
this.AddDateTextBoxCell(row);
if (this.ShowStore)
{
AddStoreSelectCell(row);
}
AddPartyCodeInputTextCell(row);
AddPartySelectCell(row);
if (this.ShowPriceTypes)
{
AddPriceTypeSelectCell(row);
}
this.AddReferenceNumberInputTextCell(row);
this.AddCashTransactionDivCell(row);
this.AddPaymentTermSelectCell(row);
table.Controls.Add(row);
}
}
示例9: btnLiteralTable_Click
protected void btnLiteralTable_Click(object sender, EventArgs e)
{
System.Web.UI.HtmlControls.HtmlTable tableT = new System.Web.UI.HtmlControls.HtmlTable();
System.Web.UI.HtmlControls.HtmlTableRow rowR = new System.Web.UI.HtmlControls.HtmlTableRow();
System.Web.UI.HtmlControls.HtmlTableCell cellA = new System.Web.UI.HtmlControls.HtmlTableCell();
System.Web.UI.HtmlControls.HtmlTableCell cellB = new System.Web.UI.HtmlControls.HtmlTableCell();
System.Web.UI.HtmlControls.HtmlTableCell cellC = new System.Web.UI.HtmlControls.HtmlTableCell();
cellA.InnerText = "t2 C1Header";
cellB.InnerText = "t2 C2Header";
cellC.InnerText = "t2 C3Header";
rowR.Cells.Add(cellA);
rowR.Cells.Add(cellB);
rowR.Cells.Add(cellC);
tableT.Rows.Add(rowR);
cellA = new HtmlTableCell();
cellB = new HtmlTableCell();
cellC = new HtmlTableCell();
rowR = new HtmlTableRow();
cellA.InnerText = "r1c1";
cellB.InnerHtml = "r2c2";
cellC.InnerText = "r3c3";
rowR.Cells.Add(cellA);
rowR.Cells.Add(cellB);
rowR.Cells.Add(cellC);
tableT.Rows.Add(rowR);
this.Controls.Add(tableT);
}
示例10: LoadUDFs
public void LoadUDFs()
{
var udfList = UDF.GetUDFList(_udfLevel, _levelID);
if (udfList.Count > 0)
{
var udfTable = new HtmlTable();
udfTable.Attributes["class"] = "fieldValueTable";
udfTable.Width = "100%";
foreach (UDF udf in udfList)
{
var tableRow = new HtmlTableRow();
var labelCell = new HtmlTableCell();
var valueCell = new HtmlTableCell();
labelCell.Attributes["class"] = "fieldLabel";
labelCell.InnerHtml = udf.Name + ":";
valueCell.InnerHtml = udf.Value;
tableRow.Cells.Add(labelCell);
tableRow.Cells.Add(valueCell);
udfTable.Rows.Add(tableRow);
udfInformationContainer.Controls.Add(udfTable);
udfTable.DataBind();
}
}
}
示例11: AddCashTransactionDivCell
private void AddCashTransactionDivCell(HtmlTableRow row)
{
using (HtmlTableCell cell = TableHelper.GetFieldCell())
{
if (this.ShowTransactionType)
{
using (HtmlGenericControl toggleCheckBox = HtmlControlHelper.GetToggleCheckBox())
{
toggleCheckBox.ID = "CashTransactionDiv";
using (HtmlInputCheckBox cashTransactionInputCheckBox = new HtmlInputCheckBox())
{
cashTransactionInputCheckBox.ID = "CashTransactionInputCheckBox";
cashTransactionInputCheckBox.Attributes.Add("checked", "checked");
toggleCheckBox.Controls.Add(cashTransactionInputCheckBox);
}
using (HtmlGenericControl label = HtmlControlHelper.GetLabel(Titles.CashTransaction))
{
toggleCheckBox.Controls.Add(label);
}
cell.Controls.Add(toggleCheckBox);
}
}
row.Cells.Add(cell);
}
}
示例12: AddTopFormLabels
private void AddTopFormLabels(HtmlTable table)
{
using (HtmlTableRow header = new HtmlTableRow())
{
TableHelper.AddCell(header, HtmlControlHelper.GetLabelHtml(Titles.ValueDate, "DateTextBox"));
if (this.ShowStore)
{
TableHelper.AddCell(header, HtmlControlHelper.GetLabelHtml(Titles.SelectStore, "StoreSelect"));
}
TableHelper.AddCell(header, HtmlControlHelper.GetLabelHtml(Titles.SelectParty, "PartyCodeInputText"));
TableHelper.AddCell(header, string.Empty);
if (this.ShowPriceTypes)
{
TableHelper.AddCell(header, HtmlControlHelper.GetLabelHtml(Titles.PriceType, "PriceTypeSelect"));
}
TableHelper.AddCell(header, HtmlControlHelper.GetLabelHtml(Titles.ReferenceNumberAbbreviated, "ReferenceNumberInputText"));
TableHelper.AddCell(header, string.Empty);
TableHelper.AddCell(header, string.Empty);
table.Rows.Add(header);
}
}
示例13: AddCell
private HtmlTableCell AddCell(HtmlTableRow row, string text)
{
var cell = new HtmlTableCell();
cell.InnerHtml = text;
row.Cells.Add(cell);
return cell;
}
示例14: AddRow
private static HtmlTableRow AddRow(JobControl_Get_Result controlResult)
{
HtmlTableRow row = new HtmlTableRow();
row.Cells.Add(AddLabel(controlResult.ControlName));
row.Cells.Add(AddControl(controlResult));
return row;
}
示例15: BuildStudentGrowthTable
protected void BuildStudentGrowthTable()
{
var table = new HtmlTable();
var headerRow = new HtmlTableRow();
table.Width = "100%";
table.Attributes["class"] = "sgTable";
//Add header row
foreach(DataColumn column in _ds.Tables[1].Columns)
{
var headerCell = new HtmlTableCell();
headerCell.Attributes["class"] = "sgTableHeadCell";
headerCell.InnerHtml = column.ColumnName;
headerRow.Cells.Add(headerCell);
}
table.Rows.Add(headerRow);
//Add body rows
foreach(DataRow row in _ds.Tables[1].Rows)
{
var tableRow = new HtmlTableRow();
foreach(DataColumn column in _ds.Tables[1].Columns)
{
var tableCell = new HtmlTableCell();
tableCell.Attributes["class"] = table.Rows.Count % 2 == 0 ? "" : "altTD";
tableCell.InnerHtml = row[column].ToString();
tableRow.Cells.Add(tableCell);
}
table.Rows.Add(tableRow);
}
if (_ds.Tables[1].Rows.Count > 1 || (_ds.Tables[1].Rows.Count > 0 && !_ds.Tables[1].Rows[0][0].ToString().Contains("N/A")))
{
//Add spacer row
var spacerRow = new HtmlTableRow();
var spacerCell = new HtmlTableCell();
spacerCell.ColSpan = _ds.Tables[1].Columns.Count;
spacerCell.InnerHtml = " ";
spacerCell.BgColor = "bababa";
spacerRow.Cells.Add(spacerCell);
table.Rows.Add(spacerRow);
//Add aggregate concordant row
var concordRow = new HtmlTableRow();
var concordCell1 = new HtmlTableCell();
var concordCell2 = new HtmlTableCell();
concordCell1.ColSpan = _ds.Tables[1].Columns.Count - 1;
concordCell2.InnerHtml = "Aggregate Concordant = <span class=\"normalText\">" + _aggregateConcordant + "</span>";
concordCell2.Attributes["class"] = "sgTableHeadCell";
concordRow.Cells.Add(concordCell1);
concordRow.Cells.Add(concordCell2);
table.Rows.Add(concordRow);
}
//Add table to panel
studentGrowDataTable.Controls.Add(table);
}