本文整理汇总了C#中System.Web.UI.WebControls.TableCell类的典型用法代码示例。如果您正苦于以下问题:C# TableCell类的具体用法?C# TableCell怎么用?C# TableCell使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TableCell类属于System.Web.UI.WebControls命名空间,在下文中一共展示了TableCell类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddRange
public void AddRange (TableCell[] cells)
{
foreach (TableCell td in cells) {
if (cc.IndexOf (td) < 0)
cc.Add (td);
}
}
示例2: Page_Load
private void Page_Load(object sender, System.EventArgs e)
{
for (int month = 0; month < 2; month++)
{
TableCell tc = new TableCell();
tc.VerticalAlign = VerticalAlign.Top;
System.Web.UI.WebControls.Calendar c = new System.Web.UI.WebControls.Calendar();
c.VisibleDate = DateTime.Today.AddMonths(month);
c.DayRender += new DayRenderEventHandler(DateCal_DayRender);
c.DayStyle.Width = Unit.Parse("30px");
c.DayStyle.Height = Unit.Parse("35px");
c.DayStyle.VerticalAlign = VerticalAlign.Top;
c.DayStyle.CssClass = "BannerCalendarDay";
c.DayHeaderStyle.CssClass = "BannerCalendarDayHeader";
c.OtherMonthDayStyle.CssClass = "BannerCalendarOtherMonthDay";
c.CssClass = "BannerCalendar";
c.TitleStyle.CssClass = "BannerCalendarTitle";
c.CellPadding = 0;
c.CellSpacing = 0;
c.ShowNextPrevMonth = false;
tc.Controls.Add(c);
Row.Cells.Add(tc);
}
}
示例3: 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 tbl1 = new System.Web.UI.WebControls.Table();
tbl1.Rows.Add(new System.Web.UI.WebControls.TableRow());
System.Web.UI.WebControls.Table tbl = new System.Web.UI.WebControls.Table();
tbl.Rows.Add(new System.Web.UI.WebControls.TableRow());
try
{
base.GHTSubTestBegin("Add cells");
base.GHTActiveSubTest.Controls.Add(tbl);
base.GHTActiveSubTest.Controls.Add(tbl1);
// add new cell
tbl1.Rows[0].Cells.Add(new System.Web.UI.WebControls.TableCell());
tbl.Rows[0].Cells.Add(new System.Web.UI.WebControls.TableCell());
System.Web.UI.WebControls.TableCell tblCell = new System.Web.UI.WebControls.TableCell();
tbl.Rows[0].Cells.Add(tblCell);
// add cell from one table to another
tbl.Rows[0].Cells.Add(tbl1.Rows[0].Cells[0]);
}
catch (Exception ex)
{
base.GHTSubTestUnexpectedExceptionCaught(ex);
}
base.GHTSubTestEnd();
base.GHTTestEnd();
}
示例4: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
WarningsCount.Text = SessionManager.Current.User.WarningMessages.Count.ToString(CultureInfo.InvariantCulture);
if (SessionManager.Current.User.WarningMessages.Count > 0)
{
int rows = 0;
foreach (string alert in SessionManager.Current.User.WarningMessages)
{
var alertRow = new TableRow();
alertRow.Attributes.Add("class", "AlertTableCell");
var component = new TableCell
{
Text = alert, Wrap = true
};
alertRow.Cells.Add(component);
WarningTable.Rows.Add(alertRow);
rows++;
if (rows == 5) break;
}
}
}
示例5: CreateChildControls
protected override void CreateChildControls()
{
Table table = new Table();
for (int i = 0; i < _colors.Length; i++)
{
TableRow row = new TableRow();
table.Rows.Add(row);
for (int j = 0; j < _colors[i].Length; j++)
{
TableCell cell = new TableCell();
cell.Style[HtmlTextWriterStyle.Width] = "10px";
cell.Style[HtmlTextWriterStyle.Height] = "10px";
cell.Style[HtmlTextWriterStyle.Cursor] = "pointer";
cell.Style["background-color"] = "#" + _colors[i][j];
cell.Attributes.Add("onclick", "setColor(\"#" + _colors[i][j] + "\")");
row.Cells.Add(cell);
HtmlGenericControl innerDiv = new HtmlGenericControl("div");
innerDiv.Style[HtmlTextWriterStyle.Height] = "100%";
innerDiv.Style[HtmlTextWriterStyle.Width] = "100%";
innerDiv.Style["font-size"] = "1px";
cell.Controls.Add(innerDiv);
}
}
table.Attributes.Add("border", "0");
table.Attributes.Add("cellspacing", "1");
table.Attributes.Add("cellpadding", "0");
table.Style["background-color"] = "#000000";
Content.Add(table);
base.CreateChildControls();
}
示例6: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
ctrlСклад.MasterViewName = Склад.Views.СкладL.Name;
ctrlСклад.MasterTypeName = typeof(Склад).AssemblyQualifiedName;
ctrlСклад.PropertyToShow = "Название";
if (Session["storagepk"] != null)
{
var ds = (SQLDataService)DataServiceProvider.DataService;
var автомашиныPseudoDetail = new PseudoDetail<Автомашина, Поступление>
(Поступление.Views.ПоступлениеE,
Information.ExtractPropertyPath<Поступление>(p => p.Автомашина));
var ВладельцыАвтомашинИзПоступленийНаСклад = ds.Query<Автомашина>(Автомашина.Views.АвтомашинаE)
.Where(a => автомашиныPseudoDetail.Any(s => s.Склад.__PrimaryKey.ToString() == ctrlСклад.SelectedMasterPK)).ToList()
.Select(c => new { Фамилия = c.ВладелецАвтомашины.Фамилия }).Distinct();
//var ВладельцыАвтомашин = АвтомашиныИзПоступленийНаСклад.Select(o => o.ВладелецАвтомашины.Фамилия).ToList();
foreach (var Владелец in ВладельцыАвтомашинИзПоступленийНаСклад)
{
TableRow tr = new TableRow();
TableCell tc = new TableCell() { Text = Владелец.Фамилия };
tr.Cells.Add(tc);
TableВладельцы.Rows.Add(tr);
}
}
//WolvOwners.LimitFunction = LinqToLcs.GetLcs(АвтомашиныИзПоступленийНаСклад.Expression,
//Автомашина.Views.АвтомашинаE).LimitFunction;
//WolvOwners.LimitFunction = LinqToLcs.GetLcs(ВладельцыАвтомашин.ToList().AsQueryable().Expression,
//Человек.Views.ЧеловекE).LimitFunction;
}
示例7: create_request_table
public void create_request_table(string stg1, string stg2)
{
TableRow row = new TableRow();
TableCell cell1 = new TableCell();
cell1.Text = "<h4 class = 'font-thai font-1d8'>" + stg1 + "</h4>";
row.Cells.Add(cell1);
cell1 = new TableCell();
cell1.Text = "<h4 class = 'font-thai font-1d8'>" + stg2 + "</h4>";
row.Cells.Add(cell1);
cell1 = new TableCell();
Button bt = new Button();
bt.CssClass = "mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent";
bt.Text = "ยืนยัน";
bt.Click += delegate
{
teacher_delete(stg1);
};
cell1.Controls.Add(bt);
bt = new Button();
bt.CssClass = "mdl-button mdl-js-button mdl-button--raised mdl-button--colored";
bt.Text = "ดู";
cell1.Controls.Add(bt);
bt = new Button();
bt.CssClass = "mdl-button mdl-js-button mdl-button--accent";
bt.Text = "ไม่ยืนยัน";
bt.Click += delegate
{
teacher_delete(stg1);
};
cell1.Controls.Add(bt);
row.Cells.Add(cell1);
request_view_table.Rows.Add(row);
}
示例8: GetAdministrationInterface
/// <summary>
/// Must create and return the control
/// that will show the administration interface
/// If none is available returns null
/// </summary>
public Control GetAdministrationInterface(Style controlStyle)
{
this._adminTable = new Table();
this._adminTable.ControlStyle.CopyFrom(controlStyle);
this._adminTable.Width = Unit.Percentage(100);
TableCell cell = new TableCell();
TableRow row = new TableRow();
cell.ColumnSpan = 2;
cell.Text = ResourceManager.GetString("NSurveySecurityAddinDescription", this.LanguageCode);
row.Cells.Add(cell);
this._adminTable.Rows.Add(row);
cell = new TableCell();
row = new TableRow();
CheckBox child = new CheckBox();
child.Checked = new Surveys().NSurveyAllowsMultipleSubmissions(this.SurveyId);
Label label = new Label();
label.ControlStyle.Font.Bold = true;
label.Text = ResourceManager.GetString("MultipleSubmissionsLabel", this.LanguageCode);
cell.Width = Unit.Percentage(50);
cell.Controls.Add(label);
row.Cells.Add(cell);
cell = new TableCell();
child.CheckedChanged += new EventHandler(this.OnCheckBoxChange);
child.AutoPostBack = true;
cell.Controls.Add(child);
Unit.Percentage(50);
row.Cells.Add(cell);
this._adminTable.Rows.Add(row);
return this._adminTable;
}
示例9: 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();
}
示例10: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
var temp = new Movie();
var movies = temp.getAll();
Table table = new Table();
foreach (int moid in movies.Keys) {
TableRow row = new TableRow();
TableCell imageCell = new TableCell();
Image image = new Image();
image.ImageUrl = movies[moid].read("imgurl").ToString();
HtmlAnchor anchor = new HtmlAnchor();
anchor.HRef = "/show_movie.aspx?moid=" + movies[moid].id;
anchor.Controls.Add(image);
imageCell.Controls.Add(anchor);
row.Controls.Add(imageCell);
TableCell cell = new TableCell();
cell.VerticalAlign = VerticalAlign.Top;
cell.Text = "<h2>" + movies[moid].read("title").ToString() + "</h2>";
row.Controls.Add(cell);
cell.Text += (movies[moid].read("description").ToString().Length > 1024) ? movies[moid].read("description").ToString().Substring(0, 1024) + "..." : movies[moid].read("description").ToString();
row.Controls.Add(cell);
table.Controls.Add(row);
}
PlaceHolder1.Controls.Add(table);
}
示例11: GridView1_RowCreated
/// <summary>
/// 排序事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
{
Int32 DataIDX = 0;
TableCell cell = null;
if (e.Row.RowType == DataControlRowType.Header)
{
#region 单选框
cell = new TableCell();
cell.Width = Unit.Pixel(5);
cell.Text = " ";
e.Row.Cells.AddAt(0, cell);
#endregion
}
else
{
//增加行选项
DataIDX = Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "ID"));
cell = new TableCell();
cell.Width = Unit.Pixel(5);
cell.Text = string.Format(" <input name='RadioButton' id='RadioButton' value='{0}' type='radio' />", DataIDX);
e.Row.Cells.AddAt(0, cell);
}
}
示例12: AddTableCell
public static TableCell AddTableCell(TableRow tableRow,
string value, SourceTextType fieldType, string toolTip = "")
{
TableCell tableCell1 = new TableCell();
string valueToPrint = "NA";
switch (fieldType)
{
case SourceTextType.DateTime:
if (!string.IsNullOrWhiteSpace(value))
{
DateTime createdDate = DateTime.Now;
createdDate = DateTime.Parse(value);
valueToPrint = SCBasics.AuditTrail.Utils.DateTimeUtil.TimeAgo(createdDate);
}
else
{
valueToPrint = "NA";
}
break;
case SourceTextType.Text:
valueToPrint = !string.IsNullOrWhiteSpace(value) ? value : "NA";
break;
default:
valueToPrint = !string.IsNullOrWhiteSpace(value) ? value : "NA";
break;
}
tableCell1.Text = valueToPrint;
tableCell1.ToolTip = toolTip;
tableRow.Cells.Add(tableCell1);
return tableCell1;
}
示例13: Button2_Click
private void Button2_Click(object sender, System.EventArgs e)
{
Table1.Rows.Clear();
OlapQueue q=OlapQueue.Instance;
for(int i=0;i<q.Count;i++)
{
TableRow row=new TableRow();
Table1.Rows.Add(row);
TableCell cell;
cell=new TableCell();
row.Cells.Add(cell);
cell.Text=q[i].ID.ToString();
cell=new TableCell();
row.Cells.Add(cell);
cell.Text=q[i].Report.Name;
cell=new TableCell();
row.Cells.Add(cell);
cell.Text=q[i].Status.ToString();
cell=new TableCell();
row.Cells.Add(cell);
cell.Text=q[i].ExecutionStarted.ToLongTimeString();
}
}
示例14: GetCellText
//辅助方法 获取每个单元格的内容
public static string GetCellText(TableCell cell)
{
string text = cell.Text;
if (!string.IsNullOrEmpty(text))
{
return text;
}
foreach (Control control in cell.Controls)
{
if (control != null && control is IButtonControl)
{
IButtonControl btn = control as IButtonControl;
text = btn.Text.Replace("\r\n", "").Trim();
break;
}
if (control != null && control is ITextControl)
{
LiteralControl lc = control as LiteralControl;
if (lc != null)
{
continue;
}
ITextControl l = control as ITextControl;
text = l.Text.Replace("\r\n", "").Trim();
break;
}
}
return text;
}
示例15: upload_button_click
protected void upload_button_click(object sender, EventArgs e)
{
if (file_upload_control.HasFile)
{
try
{
UploadedFile uf = new UploadedFile(file_upload_control.PostedFile);
foreach (PropertyInfo info in uf.GetType().GetProperties())
{
TableRow row = new TableRow();
TableCell[] cells = new TableCell[] {new TableCell(),new TableCell(),new TableCell()};
cells[0].Controls.Add(new LiteralControl(info.PropertyType.ToString()));
cells[1].Controls.Add(new LiteralControl(info.Name));
cells[2].Controls.Add(new LiteralControl(info.GetValue(uf).ToString()));
row.Cells.AddRange(cells);
file_upload_details_table.Rows.Add(row);
}
status_label.Text = "Status: OK!";
}
catch (Exception ex)
{
status_label.Text = "Status: The file could not be uploaded. The following error occured: " + ex.Message;
}
}
}