当前位置: 首页>>代码示例>>C#>>正文


C# WebControls.TableRow类代码示例

本文整理汇总了C#中System.Web.UI.WebControls.TableRow的典型用法代码示例。如果您正苦于以下问题:C# TableRow类的具体用法?C# TableRow怎么用?C# TableRow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TableRow类属于System.Web.UI.WebControls命名空间,在下文中一共展示了TableRow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load

        private void Page_Load(object sender, System.EventArgs e)
        {
            Table tb = new Table();
            tb.Width = new Unit( 100, UnitType.Percentage );
            TableRow row;
            TableCell cell;

            HyperLink lnk;

            if( Context.User.Identity.IsAuthenticated )
            {
                //create a new blank table row
                row = new TableRow();

                //set up the news link
                lnk = new HyperLink();
                lnk.Text = "News";
                lnk.NavigateUrl = "News.aspx";

                //create the cell and add the link
                cell = new TableCell();
                cell.Controls.Add(lnk);

                //add the new cell to the row
                row.Cells.Add(cell);
            }
            else
            {
                //code for unauthenticated users here
            }

            //finally, add the table to the placeholder
            phNav.Controls.Add(tb);
        }
开发者ID:mrd030485,项目名称:finna-be-ninja,代码行数:34,代码来源:Default.aspx.cs

示例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);
        }
开发者ID:romanu6891,项目名称:fivemen,代码行数:28,代码来源:MyITemplate.cs

示例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);
                }
            }
        }
开发者ID:pedul,项目名称:KenKen,代码行数:28,代码来源:KenGrid.ascx.cs

示例4: AddToTable

        /// <summary>
        /// Add the error/warning message to the table
        /// </summary>
        /// <param name="url">URL of origin of the message</param>
        /// <param name="type">Error or warning</param>
        /// <param name="line">Last Line</param>
        /// <param name="column">Last Column</param>
        /// <param name="msg">Additional error/warning message</param>
        private void AddToTable(string url, string type, string line, string column, string msg)
        {
            var tRow = new TableRow();

            var tCellUrl = new TableCell();
            tCellUrl.Text = "<a href='" + url + "' target='_blank'>" + url + "</a>";
            tRow.Cells.Add(tCellUrl);

            var tCellType = new TableCell();
            tCellType.Text = type;
            tRow.Cells.Add(tCellType);

            var tCellLine = new TableCell();
            tCellLine.Text = line;
            tRow.Cells.Add(tCellLine);

            var tCellClmn = new TableCell();
            tCellClmn.Text = column;
            tRow.Cells.Add(tCellClmn);

            var tCellMsg = new TableCell();
            tCellMsg.Text = msg;
            tRow.Cells.Add(tCellMsg);

            w3Table.Rows.Add(tRow);
        }
开发者ID:Peacefield,项目名称:DotsolutionsWebsiteTester,代码行数:34,代码来源:CodeQuality.aspx.cs

示例5: showProjects

        private void showProjects()
        {
            List<ProjectInfo> projects = ProjectInfo.getUserProjects(Membership.GetUser(false).UserName, activeProjectsOnly);

            TableRow row = new TableRow();
            Label cell = new Label();

            cell.Text = "<div class = \"tblProjects\">";

            int i = 0;
            foreach (ProjectInfo info in projects)
            {
                if (i != 2)
                {
                    cell.Text = "<img src=\"images\\tools_white.png\"/><a href =\"section.aspx?id=" + info.ProjectID + "\"><div class = projName>" + info.Name + "</div></a>"
                    + "<div class = projDesc>" + info.Description + "</div>";
                    TableCell cell1 = new TableCell();
                    cell1.Text = cell.Text.ToString();
                    row.Cells.Add(cell1);
                    i++;
                }
                else
                {
                    cell.Text = "<img src=\"images\\tools_white.png\"/><a href =\"section.aspx?id=" + info.ProjectID + "\"><div class = projName>" + info.Name + "</div></a>"
                     + "<div class = projDesc>" + info.Description + "</div></tr><tr>";
                    TableCell cell1 = new TableCell();
                    cell1.Text = cell.Text.ToString();
                    row.Cells.Add(cell1);
                    i = 0;
                }
            }
            tblProjects.Rows.Add(row);
            cell.Text += "</div>";
        }
开发者ID:BadBoyJH,项目名称:NURacing,代码行数:34,代码来源:index.aspx.cs

示例6: BuildOptionRow

 private TableRow BuildOptionRow(string label, Control optionControl, string comment, string controlComment)
 {
     TableRow row = new TableRow();
     TableCell cell = new TableCell();
     TableCell cell2 = new TableCell();
     cell.Wrap = false;
     if (label != null)
     {
         Label child = new Label();
         child.ControlStyle.Font.Bold = true;
         child.Text = label;
         child.CssClass = "AnswerTextRender";//JJ
         cell.Controls.Add(child);
         cell.VerticalAlign = VerticalAlign.Top;
         if (comment != null)
         {
             cell.Controls.Add(new LiteralControl("<br />" + comment));
         }
         row.Cells.Add(cell);
     }
     else
     {
         cell2.ColumnSpan = 2;
     }
     cell2.Controls.Add(optionControl);
     if (controlComment != null)
     {
         cell2.Controls.Add(new LiteralControl("<br />" + controlComment));
     }
     row.Cells.Add(cell2);
     return row;
 }
开发者ID:ChrisNelsonPE,项目名称:surveyproject_main_public,代码行数:32,代码来源:FreeTextBoxAnswerItem.cs

示例7: AddThemeToTable

        private void AddThemeToTable(TblThemes theme, int i)
        {
            var row = new TableRow {ID = theme.ID.ToString()};
            var number = new TableCell {Text = i.ToString(), HorizontalAlign = HorizontalAlign.Center};
            var name = new TableCell {Text = theme.Name, HorizontalAlign = HorizontalAlign.Center};
            var type = new TableCell {Text = theme.IsControl.ToString(), HorizontalAlign = HorizontalAlign.Center};

            var pageOrder = new TableCell {HorizontalAlign = HorizontalAlign.Center};
            pageOrder.Controls.Add(GetPageOrderDropDownList(theme.PageOrderRef));

            var pageCountToShow = new TableCell {HorizontalAlign = HorizontalAlign.Center};
            pageCountToShow.Controls.Add(GetPageCountToShowDropDownList(theme));

            var maxCountToSubmit = new TableCell {HorizontalAlign = HorizontalAlign.Center};
            maxCountToSubmit.Controls.Add(GetMaxCountToSubmitDropDownList(theme.MaxCountToSubmit));

            var themePages = new TableCell();
            themePages.Controls.Add(new HyperLink
            {
                Text = "Pages",
                NavigateUrl = ServerModel.Forms.BuildRedirectUrl(new ThemePagesController
                                                                     {
                    BackUrl = string.Empty,
                    ThemeId = theme.ID
                })
            });

            row.Cells.AddRange(new[] { number, name, type, pageOrder, pageCountToShow, maxCountToSubmit, themePages });
            CourseBehaviorTable.Rows.Add(row);

        }
开发者ID:supermuk,项目名称:iudico,代码行数:31,代码来源:CourseBehaviorController.cs

示例8: 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);
        }
开发者ID:cmol,项目名称:cinemaxxx,代码行数:32,代码来源:show_movies.aspx.cs

示例9: 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;
 }
开发者ID:ChrisNelsonPE,项目名称:surveyproject_main_public,代码行数:35,代码来源:NSurveyContextSecurityAddIn.cs

示例10: 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;
        }
开发者ID:shunterer,项目名称:Sitecore-Audit-Trail,代码行数:35,代码来源:UIControlUtil.cs

示例11: fillButtons

        protected void fillButtons()
        {
            // Create the row
            // We are going to use one row only
            TableRow row = new TableRow();

            // Create the cells
            TableHeaderCell addRecordsCell = new TableHeaderCell();
            TableHeaderCell addTimeOffCell = new TableHeaderCell();
            TableHeaderCell addIncomeCell = new TableHeaderCell();
            TableHeaderCell addDocumentCell = new TableHeaderCell();

            // Add the links to cells Text
            addRecordsCell.Text = @"<a class='btn btn-warning btn-employee' href='EmployeeAddRecord.aspx?id="+employee.Id+"'><i class='icon-pencil icon-white'></i> Add a Record</a>";
            addTimeOffCell.Text = @"<a class='btn btn-warning btn-employee' href='EmployeeAddTimeOff.aspx?id=" + employee.Id + "'><i class='icon-calendar icon-white'></i> Add a Time Off</a>";
            addIncomeCell.Text = @"<a class='btn btn-warning btn-employee' href='EmployeeAddIncome.aspx?id=" + employee.Id + "'><i class='icon-plus icon-white'></i> Add an Income</a>";
            addDocumentCell.Text = @"<a class='btn btn-warning btn-employee' href='EmployeeAddDocument.aspx?id=" + employee.Id + "'><i class='icon-folder-open icon-white'></i> Add a Document</a>";

            // Add the cells to the row
            row.Cells.Add(addRecordsCell);
            row.Cells.Add(addTimeOffCell);
            row.Cells.Add(addIncomeCell);
            row.Cells.Add(addDocumentCell);

            // Add the row to the table
            ButtonsTable.Rows.Add(row);

            // Add the bootstrap table class to the table
            ButtonsTable.CssClass = "table centerTD no-border-table buttons-table";
        }
开发者ID:hlj1013,项目名称:HR-System,代码行数:30,代码来源:EmployeeView.aspx.cs

示例12: 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();
            }
        }
开发者ID:GermanGlushkov,项目名称:FieldInformer,代码行数:28,代码来源:WebForm1.aspx.cs

示例13: BuildAlphaIndex

        private void BuildAlphaIndex()
        {
            string[] alphabet = new string[] { "A", "B", "C", "D", "E", "F", "G", "H",
            "I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"};

            TableRow row = new TableRow();
            TableCell cell = null;
            LinkButton lkbtn = null;

            for (int i = 0; i < alphabet.Length - 1; i++)
            {
                cell = new TableCell();
                lkbtn = new LinkButton();
                lkbtn.Text = alphabet[i].ToString();
                lkbtn.Font.Underline = true;
                lkbtn.Font.Size = 15;
                lkbtn.PostBackUrl = string.Format("IndexView.aspx?Page={0}", alphabet[i].ToString());
                cell.Controls.Add(lkbtn);
                row.Cells.Add(cell);
                cell = new TableCell();
                cell.Text = string.Empty;
                row.Cells.Add(cell);
                cell = new TableCell();
                cell.Text = string.Empty;
                row.Cells.Add(cell);
            }

            tblAZ.Rows.Add(row);
        }
开发者ID:KevinTheMix,项目名称:CSharp-Wiki,代码行数:29,代码来源:IndexView.aspx.cs

示例14: BuildRow

 /// <summary>
 /// Build a row with the given control and style
 /// </summary>
 /// <param name="child"></param>
 /// <param name="rowStyle"></param>
 /// <param name="labelText"></param>
 /// <returns></returns>
 protected TableRow BuildRow(Control child, string labelText, Style rowStyle)
 {
     TableRow row = new TableRow();
     TableCell cell = new TableCell();
     if (labelText != null)
     {
         Label label = new Label();
         label.ControlStyle.Font.Bold = true;
         label.Text = labelText;
         cell.Controls.Add(label);
         cell.Wrap = false;
         if (child == null) cell.ColumnSpan = 2;
         cell.VerticalAlign = VerticalAlign.Top;
         row.Cells.Add(cell);
  
         cell = new TableCell();
     }
     else
     {
         cell.ColumnSpan = 2;
     }
     if (child != null)
     {
         cell.Controls.Add(child);
     }
     row.Cells.Add(cell);
     row.ControlStyle.CopyFrom(rowStyle); //CSS .addinsLayout
     return row;
 }
开发者ID:ChrisNelsonPE,项目名称:surveyproject_main_public,代码行数:36,代码来源:EntryQuotaSecurityAddIn.cs

示例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;
                }
            }
        }
开发者ID:ThijsVredenbregt,项目名称:applab7,代码行数:29,代码来源:Default.aspx.cs


注:本文中的System.Web.UI.WebControls.TableRow类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。