本文整理汇总了C#中System.Web.UI.WebControls.Table类的典型用法代码示例。如果您正苦于以下问题:C# Table类的具体用法?C# Table怎么用?C# Table使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Table类属于System.Web.UI.WebControls命名空间,在下文中一共展示了Table类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateMenu
private void CreateMenu()
{
Table table = new Table();
TableRow row = new TableRow();
TableCell cell0 = new TableCell();
TableCell cell2 = new TableCell();
TableCell cell3 = new TableCell();
TableCell cell4 = new TableCell();
TableCell cell5 = new TableCell();
TableCell cell6 = new TableCell();
table.Rows.Add(row);
row.Cells.Add(cell0);
// A keyword menu configból jön
if (Helpers.GetMenuVisibility("SearchKeywordMenu.Visibility"))
{
TableCell cell1 = new TableCell();
row.Cells.Add(cell1);
}
row.Cells.Add(cell2);
row.Cells.Add(cell3);
row.Cells.Add(cell4);
row.Cells.Add(cell5);
row.Cells.Add(cell6);
}
示例2: InstantiateIn
public void InstantiateIn(Control control)
{
control.Controls.Clear();
Table table = new Table();
table.BorderWidth = Unit.Pixel(0);
table.CellSpacing = 1;
table.CellPadding = 0;
TableRow row = new TableRow();
row.VerticalAlign = VerticalAlign.Top;
table.Rows.Add(row);
TableCell cell = new TableCell();
cell.HorizontalAlign = HorizontalAlign.Right;
cell.VerticalAlign = VerticalAlign.Middle;
cell.Controls.Add(First);
cell.Controls.Add(Previous);
row.Cells.Add(cell);
cell = new TableCell();
cell.HorizontalAlign = HorizontalAlign.Center;
cell.Controls.Add(Pager);
row.Cells.Add(cell);
cell = new TableCell();
cell.VerticalAlign = VerticalAlign.Middle;
cell.Controls.Add(Next);
cell.Controls.Add(Last);
row.Cells.Add(cell);
control.Controls.Add(table);
}
示例3: DrawKenGrid
private void DrawKenGrid(Grid kenGrid)
{
container.Controls.Clear();
Table tbl = new Table();
container.Controls.Add(tbl);
for (int i = 0; i < kenGrid.Dimension; i++)
{
TableRow row = new TableRow();
tbl.Rows.Add(row);
for (int j = 0; j < kenGrid.Dimension; j++)
{
CellViewModel cellView = new CellViewModel(kenGrid.CellMatrix[i, j]);
TableCell cell = new TableCell();
DefineBorder(cell, cellView);
row.Cells.Add(cell);
KenCell kenCell = (KenCell)LoadControl("KenCell.ascx");
kenCell.ID = "kencell-" + i.ToString() + "-" + j.ToString();
kenCell.Cell = cellView;
cell.Controls.Add(kenCell);
}
}
}
示例4: btnGO_Click
protected void btnGO_Click(object sender, EventArgs e)
{
//url encoded
//base64
//sha1
//encryption with password
string secret = txtString.Text;
string key = String.IsNullOrEmpty(txtPassword.Text) ? hardCodedKey : txtPassword.Text;
Table t = new Table();
t.Width = new Unit("100%");
t.Rows.Add(MakeRow("Custom Crypto", CustomCryptoEncrypt(secret)));
t.Rows.Add(MakeRow("URL Encoded:", Server.UrlEncode(secret)));
t.Rows.Add(MakeRow("Base64 Encoded:", Base64(secret)));
t.Rows.Add(MakeRow("SHA1 Hashed:", SHA(secret, WG_Hash.Sha1)));
t.Rows.Add(MakeRow("SHA256 Hashed:", SHA(secret, WG_Hash.Sha256)));
t.Rows.Add(MakeRow("Rijndael Encrypted: ", Encypt(secret, key), Color.LightGreen));
ContentPlaceHolder cph = (ContentPlaceHolder)this.Master.FindControl("BodyContentPlaceholder");
cph.Controls.Add(new LiteralControl("<p/>"));
cph.Controls.Add(t);
}
示例5: GetEmptyData
/// <summary>
/// Loads an empty (new) row from the database into the specified Table.
/// <param name="table">The Table object to populate with empty data.</param>
/// </summary>
public static void GetEmptyData(Table table)
{
Row r = new Row(table);
for (int i = 0; i < table.Columns.Count; i++)
{
RowCell c = new RowCell(table.Columns[i].ColumnId, r) {Row = r};
if (table.Columns[i].ColumnType == ColumnType.ColumnTemplate)
c.Value = ((ColumnTemplate)table.Columns[i]).CreateCellControls;
else if (c.Value == null && table.Columns[i].DefaultValue != null)
c.Value = table.Columns[i].DefaultValue;
r.Cells.Add(c);
}
if (table.m_Grid.MasterWebGrid == null)
{
table.Rows.Add(r);
return;
}
List<Column> masterWebGridPrimarykeys = table.m_Grid.MasterWebGrid.MasterTable.Columns.Primarykeys;
int index = 0;
while (index < masterWebGridPrimarykeys.Count)
{
string columnname = masterWebGridPrimarykeys[index].ColumnId;
if (r.Columns.GetIndex(columnname) > -1)
r[columnname].Value = table.m_Grid.MasterWebGrid.MasterTable.Rows[0][columnname].Value;
index++;
}
table.Rows.Add(r);
}
示例6: populateTable
private void populateTable(Table table)
{
Dictionary<Product, int> items = Cart.Instance().Items;
foreach (Product product in items.Keys)
{
TableRow row = new TableRow();
TableCell productCell = new TableCell();
TableCell descriptionCell = new TableCell();
TableCell quantityCell = new TableCell();
TableCell priceCell = new TableCell();
TableCell totalCell = new TableCell();
int quantity = items[product];
productCell.Text = product.Name;
descriptionCell.Text = product.Description;
quantityCell.HorizontalAlign = HorizontalAlign.Center;
quantityCell.Text = quantity.ToString();
priceCell.Text = String.Format("R$ {0:0.00}", product.Price);
totalCell.Text = String.Format("R$ {0:0.00}", quantity * product.Price);
row.Cells.Add(productCell);
row.Cells.Add(descriptionCell);
row.Cells.Add(quantityCell);
row.Cells.Add(priceCell);
row.Cells.Add(totalCell);
table.Rows.Add(row);
}
}
示例7: Page_Load
private void Page_Load(object sender, System.EventArgs e)
{
//Put user code to initialize the page here
base.GHTTestBegin((HtmlForm)this.FindControl("Form1"));
System.Web.UI.WebControls.Table tbl = new System.Web.UI.WebControls.Table();
tbl.Rows.Add(new System.Web.UI.WebControls.TableRow());
tbl.Rows.Add(new System.Web.UI.WebControls.TableRow());
//add new cell
tbl.Rows[0].Cells.Add(new System.Web.UI.WebControls.TableCell());
tbl.Rows[0].Cells.Add(new System.Web.UI.WebControls.TableCell());
tbl.Rows[0].Cells.Add(new System.Web.UI.WebControls.TableCell());
tbl.Rows[0].Cells.Add(new System.Web.UI.WebControls.TableCell());
tbl.Rows[0].Cells[0].Text = "111";
tbl.Rows[0].Cells[1].Text = "222";
tbl.Rows[0].Cells[2].Text = "333";
tbl.Rows[0].Cells[3].Text = "444";
try
{
base.GHTSubTestBegin("RemoveAt");
base.GHTActiveSubTest.Controls.Add(tbl);
tbl.Rows[0].Cells.RemoveAt(1);
}
catch (Exception ex)
{
base.GHTSubTestUnexpectedExceptionCaught(ex);
}
base.GHTSubTestEnd();
base.GHTTestEnd();
}
示例8: ExportFromTable
public ExportFromTable(Table table)
{
table.Rows.OfType<TableRow>()
.Where(r => r.Visible)
.Select(ExportRow)
.ForEach(ExportTable.AddRow);
}
示例9: InitializeTable
/// <summary>
/// Initialize table from the DataSet object.
/// </summary>
/// <param name="table">Table object to initialize.</param>
/// <param name="dataSet">Series data.</param>
/// <param name="tableName">Series name to be used.</param>
/// <param name="firstColumnWidth">First column width.</param>
/// <param name="otherColumnWidth">Others columns width.</param>
public void InitializeTable(Table table, DataSet dataSet, string tableName, int firstColumnWidth, int otherColumnWidth)
{
foreach(DataColumn column in dataSet.Tables[tableName].Columns)
{
// Create new table row for each column
TableRow row = new TableRow();
// Add title cell
TableCell cell = new TableCell();
cell.Controls.Add(new LiteralControl(dataSet.Tables[tableName].TableName +
" - " + column.ColumnName));
cell.Width = new Unit(firstColumnWidth, UnitType.Pixel);
row.Cells.Add(cell);
// Add data cells
int pointIndex = 0;
foreach(DataRow dataRow in dataSet.Tables[tableName].Rows)
{
TableCell dataCell = new TableCell();
dataCell.Controls.Add(new LiteralControl(dataRow[column].ToString()));
dataCell.Width = new Unit(otherColumnWidth, UnitType.Pixel);
dataCell.HorizontalAlign = HorizontalAlign.Center;
row.Cells.Add(dataCell);
++pointIndex;
}
// Add row into the table
table.Rows.Add(row);
}
}
示例10: renderSimilarProduct
private Panel renderSimilarProduct(Item item)
{
Panel similarProductsItemContainer = new Panel();
similarProductsItemContainer.CssClass = "SimilarProductsItemContainer";
Table table = new Table();
TableRow tableRow = new TableRow();
TableCell tableCell = new TableCell();
Panel itemImageBg = new Panel();
itemImageBg.CssClass = "itemImageBg";
Image image = new Image();
image.ImageUrl = item.ImageUrl;
itemImageBg.Controls.Add(image);
tableCell.Controls.Add(itemImageBg);
tableRow.Controls.Add(tableCell);
tableCell = new TableCell();
Panel itemImageTitle = new Panel();
itemImageTitle.CssClass = "itemImageTitle";
Label label = new Label();
label.Text = item.Title;
itemImageTitle.Controls.Add(label);
tableCell.Controls.Add(itemImageTitle);
tableRow.Controls.Add(tableCell);
table.Controls.Add(tableRow);
similarProductsItemContainer.Controls.Add(table);
return similarProductsItemContainer;
}
示例11: Render
//public
/// <summary>
/// Render this control to the output parameter specified.
/// </summary>
/// <param name="output"> The HTML writer to write out to </param>
protected override void Render(HtmlTextWriter output)
{
NdiMenuItem item0 =
new NdiMenuItem(0, "Állás keresések listája", "Elérhetõ állás keresések szûréssel", "JobFinds.aspx", "_images/searchKexWordS.gif",
"_images/searchKexWordL.gif");
NdiMenuItem item1 =
new NdiMenuItem(1, "Új állás keresés rögzítése", "Új állás keresés rögzítése", "JobFindCreate.aspx", "_images/searchFreeTextS.gif",
"_images/searchFreeTextL.gif");
NdiMenuItem item2 =
new NdiMenuItem(2, "Milyen keresésekre válaszoltam", "Milyen keresésekre válaszoltam", "JobFindMyAnswers.aspx", "_images/searchQuestionFormS.gif",
"_images/searchQuestionFormL.gif");
NdiMenuItem item3 =
new NdiMenuItem(3, "Saját állás kereséseim", "Saját állás kereséseim", "JobFindsFromMe.aspx", "_images/searchQuestionFormS.gif",
"_images/searchQuestionFormL.gif");
Table table = new Table();
table.CellPadding = 0;
table.CellSpacing = 0;
table.CssClass = "almenu";
TableRow row1 = new TableRow();
TableRow row2 = new TableRow();
TableCell cell0 = CreateCell(item0);
TableCell cell1 = CreateCell(item1);
TableCell cell2 = CreateCell(item2);
TableCell cell3 = CreateCell(item3);
table.Rows.Add(row2);
table.Rows.Add(row1);
if (item0.Index == m_selectedindex)
row1.Cells.Add(cell0);
else
row2.Cells.Add(cell0);
if (item1.Index == m_selectedindex)
row1.Cells.Add(cell1);
else
row2.Cells.Add(cell1);
if (item2.Index == m_selectedindex)
row1.Cells.Add(cell2);
else
row2.Cells.Add(cell2);
if (item3.Index == m_selectedindex)
row1.Cells.Add(cell3);
else
row2.Cells.Add(cell3);
if (row1.Cells != null && row1.Cells.Count > 0 && row2.Cells != null && row2.Cells.Count > 0)
{
row1.Cells[0].ColumnSpan = row2.Cells.Count;
}
table.Width = Unit.Percentage(100);
table.RenderControl(output);
}
示例12: GetCentPercentTable
public static Table GetCentPercentTable()
{
Table t = new Table();
t.Width = new Unit(100.00, UnitType.Percentage);
t.Attributes.Add("style","table-layout:fixed;");
return t;
}
示例13: CreateChildControls
protected override void CreateChildControls()
{
base.CreateChildControls();
var tbl = new Table();
var row = new TableRow();
var cell = new TableCell
{
ColumnSpan = 2,
VerticalAlign = VerticalAlign.Middle,
HorizontalAlign = HorizontalAlign.Center
};
var lblTitle = new Label {Text = "This WebPart will send a parameter to a consumer:"};
cell.Controls.Add(lblTitle);
row.Controls.Add(cell);
tbl.Controls.Add(row);
row = new TableRow();
cell = new TableCell {VerticalAlign = VerticalAlign.Middle, HorizontalAlign = HorizontalAlign.Center};
_textBox = new TextBox {Text = "", Width = Unit.Pixel(120)};
cell.Controls.Add(_textBox);
row.Controls.Add(cell);
cell = new TableCell {VerticalAlign = VerticalAlign.Middle, HorizontalAlign = HorizontalAlign.Center};
_button = new Button {Text = "Send..."};
_button.Click += btn_Click;
cell.Controls.Add(_button);
row.Controls.Add(cell);
tbl.Controls.Add(row);
Controls.Add(tbl);
}
示例14: Refresh
public void Refresh() {
Controls.Clear();
if (Page != null) {
int i = 0;
// ClientScriptProxy.Current.Page =(Page) ((WebWindowTemplateHttpHandler) HttpContext.Current.Handler).ActualHandler;
string noImageUrl = ClientScriptProxy.Current.GetWebResourceUrl(GetType(), "Xpand.ExpressApp.Thumbnail.Web.Resources.noimage.jpg");
if (DataSource != null) {
var rootTable = new Table();
Controls.Add(rootTable);
var tableRow = new TableRow();
var tableCell = new TableCell();
tableRow.Cells.Add(tableCell);
rootTable.Rows.Add(tableRow);
foreach (IPictureItem item in DataSource) {
Table table = CreateTable(tableCell.Controls);
var img = new System.Web.UI.WebControls.Image { ID = ID + "_" + (i++) };
var requestTextPictureItemEventArgs = new RequestTextPictureItemEventArgs(item);
OnRequestText(requestTextPictureItemEventArgs);
SetImageProperties(item, img, noImageUrl,requestTextPictureItemEventArgs.Text);
CreateImageRow(img, table);
CreateTextRow(item, requestTextPictureItemEventArgs.Text, table);
}
}
}
}
示例15: CreateChildControls
protected override void CreateChildControls()
{
PopupBGIButton ok = new PopupBGIButton();
ok.Text = GetButton("OK");
ok.Name = "OK";
ok.CssClass += " " + "ajax__htmleditor_popup_confirmbutton ";
PopupBGIButton cancel = new PopupBGIButton();
cancel.Text = GetButton("Cancel");
cancel.Name = "Cancel";
cancel.CssClass += " " + "ajax__htmleditor_popup_confirmbutton";
Table table = new Table();
table.Attributes.Add("border", "0");
table.Attributes.Add("cellspacing", "0");
table.Attributes.Add("cellpadding", "0");
table.Style["width"] = "100%";
TableRow row = new TableRow();
table.Rows.Add(row);
TableCell cell = new TableCell();
row.Cells.Add(cell);
cell.HorizontalAlign = HorizontalAlign.Right;
cell.Controls.Add(ok);
cell.Controls.Add(cancel);
Content.Add(table);
RegisteredHandlers.Add(new RegisteredField("OK", ok));
RegisteredHandlers.Add(new RegisteredField("Cancel", cancel));
base.CreateChildControls();
}