• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# WebControls.TableHeaderRow类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: BindGrid

        public static void BindGrid(this GridView grid, object dataSource, string emptyText)
        {
            grid.DataSource = dataSource;
            grid.DataBind();

            if (grid.Rows.Count == 0)
            {
                var table = new Table();
                table.CssClass = grid.CssClass;
                var tr = new TableHeaderRow();
                foreach (DataControlField column in grid.Columns)
                {
                    if (column.Visible)
                    {
                        var th = new TableHeaderCell();
                        th.Width = column.HeaderStyle.Width;
                        th.Text = column.HeaderText;
                        tr.Controls.Add(th);
                    }
                }
                table.Controls.Add(tr);
                if (!string.IsNullOrEmpty(emptyText))
                {
                    var emptyRow = new TableRow();
                    var emptyCell = new TableCell();
                    emptyCell.CssClass = "empty";
                    emptyCell.ColumnSpan = tr.Controls.Count;
                    emptyCell.Text = emptyText;
                    emptyRow.Controls.Add(emptyCell);
                    table.Controls.Add(emptyRow);
                }
                grid.Parent.Controls.Add(table);
            }
        }
开发者ID:known,项目名称:Known,代码行数:34,代码来源:GridViewExtension.cs


示例2: CreateHeaderRow

 private void CreateHeaderRow()
 {
     TableHeaderRow headerRow = new TableHeaderRow { CssClass = "titles" };
     headerRow.Cells.Add(new TableHeaderCell { Text = "Visitor Language" });
     headerRow.Cells.Add(new TableHeaderCell { Text = "Fallback Language" });
     tblFallbackLanguages.Rows.Add(headerRow);
 }
开发者ID:dpawatts,项目名称:zeus,代码行数:7,代码来源:Default.aspx.cs


示例3: BuildFieldDescTable

        public static Table BuildFieldDescTable(IEnumerable<Tuple<string, string>> dataRows)
        {
            Table table = new Table();
            TableHeaderRow thr = new TableHeaderRow();
            TableCell hc1 = new TableCell();
            TableCell hc2 = new TableCell();
            hc1.Text = "Field";
            hc2.Text = "Description";
            thr.Cells.Add(hc1);
            thr.Cells.Add(hc2);

            foreach (Tuple<string, string> dataRow in dataRows)
            {
                TableRow r = new TableRow();
                TableCell c1 = new TableCell();
                TableCell c2 = new TableCell();
                c1.Text = dataRow.Item1;
                c2.Text = dataRow.Item2;
                r.Cells.Add(c1);
                r.Cells.Add(c2);
                table.Rows.Add(r);
            }

            return table;
        }
开发者ID:greathouse,项目名称:dwolla-sdk-dotnet,代码行数:25,代码来源:WebUIUtility.cs


示例4: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            for (int rowCount = 0; rowCount < brochure.Length; rowCount++) {
                TableRow row = new TableRow();
                row.ID = "row" + rowCount;
                table1.Rows.Add(row);
                for (int colCount = 0; colCount < 2; colCount++) {
                    TableCell cell = new TableCell();
                    cell.ID = String.Format("cell {0}{1}", rowCount, colCount);
                    row.Cells.Add(cell);
                    if (colCount == 0) {
                        Label label = new Label();
                        label.ID = String.Format("label{0}{1}", rowCount, colCount);
                        label.Text = brochure[rowCount];
                        cell.Controls.Add(label);
                    }
                    else {
                        TextBox textBox = new TextBox();
                        textBox.ID = String.Format("textBox{0}{1}", rowCount, colCount);
                        Debug.WriteLine(textBox.ID);
                        cell.Controls.Add(textBox);
                    }

                }

            }
            TableHeaderRow tableHeader = new TableHeaderRow();
            TableHeaderCell cell1 = new TableHeaderCell();
            TableHeaderCell cell2 = new TableHeaderCell();
            cell1.Text = "Brochure";
            cell2.Text = "Antal";
            tableHeader.Cells.Add(cell1);
            tableHeader.Cells.Add(cell2);
            table1.Rows.AddAt(0, tableHeader);
        }
开发者ID:KasperFlye,项目名称:CsharpAndDotNet,代码行数:35,代码来源:Default.aspx.cs


示例5: BuildCampaignsTable

        private void BuildCampaignsTable()
        {
            TableHeaderCell hCell = null;
            TableHeaderRow hRow = null;

            this.campaignsTable.Rows.Clear();

            hRow = new TableHeaderRow();

            hCell = new TableHeaderCell();
            hCell.Text = "Id";
            hCell.ID = "campaignIdHeaderTH";
            hCell.CssClass = "EditorTableHeaders";
            hRow.Cells.Add(hCell);

            hCell = new TableHeaderCell();
            hCell.Text = "Description";
            hCell.ID = "campaignDescriptionHeaderTH";
            hCell.CssClass = "EditorTableHeaders";
            hRow.Cells.Add(hCell);

            hCell = new TableHeaderCell();
            hCell.Text = "Status";
            hCell.ID = "statusHeaderTH";
            hCell.CssClass = "EditorTableHeaders";
            hRow.Cells.Add(hCell);

            this.campaignsTable.Rows.Add(hRow);

            this.countLabel.Text = "Campaign Schedules Found: 0";

            this.campaignsTable.Attributes.Add("class", "sortable EditorTables");
        }
开发者ID:vm-aorcasitas,项目名称:C8-Ux2CampaignSystem,代码行数:33,代码来源:EditorMain.aspx.cs


示例6: Button1_Click

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (!CtoF.Checked && !FtoC.Checked || CtoF.Checked && FtoC.Checked) {
                ModelState.AddModelError(String.Empty,
                    "Välj konvertering från Celsius till Fahrenheit eller från Fahrenheit till Celsius");
            }

            if (IsValid) {
                var start = int.Parse(Start.Text);
                var end = int.Parse(End.Text);
                var step = int.Parse(Step.Text);

                var thead = new TableHeaderRow();
                var theadC = new TableHeaderCell {
                    Text = "&deg;C"
                };
                var theadF = new TableHeaderCell {
                    Text = "&deg;F"
                };

                if (CtoF.Checked) {
                    thead.Cells.Add(theadC);
                    thead.Cells.Add(theadF);
                } else {
                    thead.Cells.Add(theadF);
                    thead.Cells.Add(theadC);
                }

                Table.Rows.Add(thead);

                for (int temp = start; temp <= end; temp += step) {
                    var trow = new TableRow();
                    trow.Cells.Add(new TableCell {
                        Text = temp.ToString()
                    });

                    if (CtoF.Checked) {
                        trow.Cells.Add(new TableCell {
                            Text = TemperatureConverter.CelsiusToFahrenheit(temp).ToString()
                        });
                    } else {
                        trow.Cells.Add(new TableCell {
                            Text = TemperatureConverter.FahrenheitToCelsius(temp).ToString()
                        });
                    }

                    Table.Rows.Add(trow);
                }

                Table.Visible = true;
            } else {
                Table.Visible = false;
            }
        }
开发者ID:re222dv,项目名称:vt14-1-3-konvertera-temperaturer,代码行数:54,代码来源:Default.aspx.cs


示例7: Page_Init

        protected void Page_Init(object sender, EventArgs e)
        {
            if (Request.Cookies["UserSettings"] != null)
            {
                if (Request.Cookies["UserSettings"]["Name"] != null)
                    linkBtnUsername.Text = Request.Cookies["UserSettings"]["Name"];
                else
                    Response.Redirect("login.aspx");
            }
            else
                Response.Redirect("login.aspx");

            if (Session["userID"] == null)
                Response.Redirect("board.aspx");

            List<string> results = (List<string>)Session["links"];
            TableHeaderRow thr = new TableHeaderRow();
            TableHeaderCell thc = new TableHeaderCell();
            TableHeaderCell thc1 = new TableHeaderCell();
            TableHeaderCell thc2 = new TableHeaderCell();
            TableHeaderCell thc3 = new TableHeaderCell();
            thr.Cells.Add(thc);
            thc.Text = "Title";
            thr.Cells.Add(thc1);
            thc1.Text = "Start Date";
            thr.Cells.Add(thc2);
            thc2.Text = "End Date";
            thr.Cells.Add(thc3);
            thc3.Text = "Assignee";

            TableSearchResults.Rows.Add(thr);
            foreach (string li in results)
            {
                TableRow tr = new TableRow();

                string[] str = li.Split('+');
                TableCell tc = new TableCell();
                TableCell tc1 = new TableCell();
                TableCell tc2 = new TableCell();
                TableCell tc3 = new TableCell();

                tc.Text = str[0];
                tc1.Text = str[1];
                tc2.Text = str[2];
                tc3.Text = str[3];

                tr.Cells.Add(tc);
                tr.Cells.Add(tc1);
                tr.Cells.Add(tc2);
                tr.Cells.Add(tc3);

                TableSearchResults.Rows.Add(tr);
            }
        }
开发者ID:NghiemTrung,项目名称:kanbean,代码行数:54,代码来源:SearchResults.aspx.cs


示例8: displayResults

        private void displayResults()
        {
            if (Session["recallList"] == null)
              {
            Response.Redirect("Home.asp"); // Session Timeout
              }

              // Get the search results...
              List<RecallFoodAlertData> recallList = (List<RecallFoodAlertData>)Session["recallList"];
              recallList = recallList.OrderBy(t => t.Classification).ThenByDescending(t => t.ReportDate).ToList<RecallFoodAlertData>();

              // Build the table rows and display the results
              TableHeaderRow thr = new TableHeaderRow();

              System.Text.StringBuilder resultsHTML = new System.Text.StringBuilder();
              resultsDiv.InnerHtml = "No results found";
              foreach (RecallFoodAlertData rfad in recallList)
              {

            string imageUrl = "";
            switch (rfad.Classification.ToUpper())
            {
              case "CLASS I":
            imageUrl = "img/risk-high.png";
            break;
              case "CLASS II":
            imageUrl = "img/risk-med.png";
            break;
              case "CLASS III":
            imageUrl = "img/risk-low.png";
            break;
              default:
            imageUrl = "img/No-Data.png";
            break;
            }
            resultsHTML.Append("<div class='search-result-container large-12 medium-12 small-12 columns'>");
            resultsHTML.Append("<div class='search-result-box box'>");
            string hrefUrl = string.Format("Details.aspx?recall={0}", rfad.RecallNumber);
            resultsHTML.Append("<h3><a href='" + hrefUrl + "'>" + rfad.FirmName + "</a></h3>");
            resultsHTML.Append("<div class='search-result-details large-11 medium-11 small-9 columns'>");
            resultsHTML.Append("<h4>Initiation Date: " + rfad.InitiationDate.ToString("MM/dd/yyyy") + "</h4>");
            resultsHTML.Append("<p>" + rfad.ProductDescription + "</p>");
            resultsHTML.Append("</div>");
            resultsHTML.Append("<div class='no-pad-right large-1 medium-1 small-3 columns'>");
            resultsHTML.Append("<img class='risk-level right' src='" + imageUrl + "' />");
            resultsHTML.Append("</div></div></div>");

              }
              if (resultsHTML.Length > 0)
              {
            resultsDiv.InnerHtml = resultsHTML.ToString();
              }
        }
开发者ID:tdeel,项目名称:RecallAlert-Food,代码行数:53,代码来源:Search.aspx.cs


示例9: btnAddFoodItemToShoppingList_Click

 protected void btnAddFoodItemToShoppingList_Click(object sender, EventArgs e)
 {
     double num;
     string amount = txtAmount.Text;
     bool isNum = Double.TryParse(amount, out num);
     if (amount != "")
     {
         if (isNum)
         {
             lbFoodItemID.Items.Add(ddlFoodItem.SelectedValue);
             lbFoodItemID.Items[lbFoodItemID.Items.Count - 1].Value = txtAmount.Text;
             tbFoodItem.Rows.Clear();
             TableHeaderRow tbHeaderRow = new TableHeaderRow();
             tbFoodItem.Rows.Add(tbHeaderRow);
             TableHeaderCell tbHeaderCellName = new TableHeaderCell();
             TableHeaderCell tbHeaderCellAmount = new TableHeaderCell();
             tbHeaderCellName.Text = "Name";
             tbHeaderCellAmount.Text = "Amount";
             tbHeaderRow.Cells.Add(tbHeaderCellName);
             tbHeaderRow.Cells.Add(tbHeaderCellAmount);
             for (int k = 0; k < lbFoodItemID.Items.Count; k++)
             {
                 string foodid = lbFoodItemID.Items[k].Text;
                 OleDbCommand command = new OleDbCommand("SELECT * FROM FoodItem WHERE FoodItemID = " + foodid.ToString(), myConnection);
                 command.CommandType = CommandType.Text;
                 OleDbDataReader reader = command.ExecuteReader();
                 bool notEoF = reader.Read();
                 while (notEoF)
                 {
                     TableRow tbRow = new TableRow();
                     tbFoodItem.Rows.Add(tbRow);
                     TableCell tbCellName = new TableCell();
                     TableCell tbCellAmount = new TableCell();
                     tbCellName.Text = reader["Name"].ToString();
                     tbCellAmount.Text = lbFoodItemID.Items[k].Value + " " + reader["UnitType"].ToString();
                     tbRow.Cells.Add(tbCellName);
                     tbRow.Cells.Add(tbCellAmount);
                     notEoF = reader.Read();
                 }
                 reader.Close();
             }
         }
         else
         {
             lblAmount.Text = "Amount is Invalid";
         }
     }
     else
     {
         lblAmount.Text = "Amount Required";
     }
 }
开发者ID:trinhphandinhhuy,项目名称:FoodApp,代码行数:52,代码来源:AddShoppingList.aspx.cs


示例10: RenderTable

        protected void RenderTable(bool CelciusToFahrenheit, int startValue, int endValue, int stepValue)
        {
            //skapar tableheader
            var thCell1 = new TableHeaderCell();
            var thCell2 = new TableHeaderCell();
            if (CelciusToFahrenheit)
            {
                thCell1.Controls.Add(new LiteralControl("°C"));
                thCell2.Controls.Add(new LiteralControl("°F"));
            }
            else
            {
                thCell1.Controls.Add(new LiteralControl("°F"));
                thCell2.Controls.Add(new LiteralControl("°C"));
            }
            var thRow = new TableHeaderRow();
            thRow.Controls.Add(thCell1);
            thRow.Controls.Add(thCell2);
            tblResults.Controls.Add(thRow);

            //skapar tablebody
            while (startValue <= endValue)
            {
                var row = new TableRow();
                var cell = new TableCell();
                cell.Controls.Add(
                    new LiteralControl(
                        startValue.ToString()));
                row.Controls.Add(cell);
                cell = new TableCell();

                if (CelciusToFahrenheit)
                {
                    cell.Controls.Add(
                        new LiteralControl(
                            TemperatureConverter.CelciusToFahrenheit(startValue).ToString()));
                }
                else
                {
                    cell.Controls.Add(
                        new LiteralControl(
                            TemperatureConverter.FahrenheitToCelcius(startValue).ToString()));
                }

                row.Controls.Add(cell);
                tblResults.Rows.Add(row);

                startValue += stepValue;

            }
        }
开发者ID:hl222ih,项目名称:1dv406,代码行数:51,代码来源:Default.aspx.cs


示例11: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     using (var conn = new SqlConnection("Server=(local);DataBase=Nutrition;Integrated Security=SSPI"))
     {
         using (var command = new SqlCommand("dbo.Food_Nutrition_Get", conn)
         {
             CommandType = CommandType.StoredProcedure
         })
         {
             conn.Open();
             var reader = command.ExecuteReader(CommandBehavior.CloseConnection);
             if (reader.HasRows)
             {
                 TableHeaderRow header = new TableHeaderRow();
                 header.Cells.Add(new TableHeaderCell { Text = "Food Name" });
                 header.Cells.Add(new TableHeaderCell { Text = "Calories" });
                 header.Cells.Add(new TableHeaderCell { Text = "Water" });
                 header.Cells.Add(new TableHeaderCell { Text = "Protein" });
                 header.Cells.Add(new TableHeaderCell { Text = "Lipid" });
                 header.Cells.Add(new TableHeaderCell { Text = "Carbohydrate" });
                 header.Cells.Add(new TableHeaderCell { Text = "Fiber" });
                 header.Cells.Add(new TableHeaderCell { Text = "Sugar" });
                 header.Cells.Add(new TableHeaderCell { Text = "Calcium" });
                 header.Cells.Add(new TableHeaderCell { Text = "Iron" });
                 header.TableSection = TableRowSection.TableHeader;
                 this.domainsTable.Rows.Add(header);
                 TableRow tr;
                 while (reader.Read())
                 {
                     tr = new TableRow();
                     tr.Attributes.Add("onclick", "SelectFood(this);");
                     tr.Attributes.Add("foodkey", reader["Food_Key"].ToString());
                     tr.Attributes.Add("foodunitkey", reader["Food_Unit_Key"].ToString());
                     tr.Attributes.Add("foodname", reader["Name"].ToString());
                     tr.Cells.Add(new TableCell { Text = reader["Name"].ToString() });
                     tr.Cells.Add(new TableCell { Text = reader["Calories"].ToString(), CssClass = "Number" });
                     tr.Cells.Add(new TableCell { Text = reader["Water"].ToString(), CssClass = "Number" });
                     tr.Cells.Add(new TableCell { Text = reader["Protein"].ToString(), CssClass = "Number" });
                     tr.Cells.Add(new TableCell { Text = reader["Lipid"].ToString(), CssClass = "Number" });
                     tr.Cells.Add(new TableCell { Text = reader["Carbohydrate"].ToString(), CssClass = "Number" });
                     tr.Cells.Add(new TableCell { Text = reader["Fiber"].ToString(), CssClass = "Number" });
                     tr.Cells.Add(new TableCell { Text = reader["Sugar"].ToString(), CssClass = "Number" });
                     tr.Cells.Add(new TableCell { Text = reader["Calcium"].ToString(), CssClass = "Number" });
                     tr.Cells.Add(new TableCell { Text = reader["Iron"].ToString(), CssClass = "Number" });
                     this.domainsTable.Rows.Add(tr);
                 }
             }
             conn.Close();
         }
     }
 }
开发者ID:hchen3527,项目名称:FinalProject1,代码行数:51,代码来源:NutritionalDisplay.aspx.cs


示例12: initTable

        /// <summary>
        /// Init the table to view informations
        /// </summary>
        private void initTable()
        {
            TableHeaderRow header = new TableHeaderRow();
            header.CssClass = "tableAlternateHeader";
            InscriptionsTable.Controls.Add(header);

            TableCell hProjects = new TableCell();
            hProjects.Text = "Projets";
            header.Controls.Add(hProjects);

            TableCell hStudents = new TableCell();
            hStudents.Text = "Etudiant inscrits";
            header.Controls.Add(hStudents);
        }
开发者ID:jeremysingy,项目名称:pi-manager,代码行数:17,代码来源:VisualizationInscription.aspx.cs


示例13: CreateHeaderRow

        private void CreateHeaderRow(Table table)
        {
            using (TableHeaderRow header = new TableHeaderRow())
            {
                header.TableSection = TableRowSection.TableHeader;

                this.AddHeaderCell(header, "340px", Titles.Comment);
                this.AddHeaderCell(header, "50px", Titles.Upload, "nopadding");
                this.AddHeaderCell(header, "240px", Titles.Progress);
                this.AddHeaderCell(header, "", Titles.FilePath);

                table.Rows.Add(header);
            }
        }
开发者ID:JonathanValle,项目名称:mixerp,代码行数:14,代码来源:HeaderRow.cs


示例14: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            Ado.ClasesComunes.Periodo _periodoActual = new Ado.ClasesComunes.Periodo();
            IMetodosAdministrador _metAdministrador = new MetodosAdministrador();
            _periodoActual = _metAdministrador.UltimoPeriodo();
            if (_periodoActual != null)
            {
                LinkedList<string> _encabezados = new LinkedList<string>();
                _encabezados.AddLast("Identificación");
                _encabezados.AddLast("Fecha de Inicio");
                _encabezados.AddLast("Fecha de Fin");
                _encabezados.AddLast("Estado");
                _encabezados.AddLast("Modalidad");
                _encabezados.AddLast("Año");
                _encabezados.AddLast("Número de Periodo");
                TableHeaderRow _encabezado = new TableHeaderRow();
                foreach (var _elemento in _encabezados)
                {
                    TableHeaderCell _celda = new TableHeaderCell();
                    _celda.Text = _elemento;
                    _encabezado.Cells.Add(_celda);
                }

                LinkedList<string> _periodo = new LinkedList<string>();
                _periodo.AddLast(_periodoActual.Id_Periodo.ToString());
                _periodo.AddLast(_periodoActual.Fec_Inicio.Date.ToString());
                _periodo.AddLast(_periodoActual.Fec_Fin.Date.ToString());
                _periodo.AddLast(_periodoActual.Txt_Estado);
                _periodo.AddLast(_periodoActual.Txt_Modalidad);
                _periodo.AddLast(_periodoActual.Num_Anno.ToString());
                _periodo.AddLast(_periodoActual.Num_Periodo.ToString());
                TableRow _fila = new TableRow();
                foreach (var _elemento in _periodo)
                {
                    TableCell _celda = new TableCell();
                    _celda.Text = _elemento;
                    _fila.Cells.Add(_celda);
                }
                //Lleno tabla
                tblPeriodo.Rows.Add(_encabezado);
                tblPeriodo.Rows.Add(_fila);

            }
            else
            {
                //Agrego Label que diga que no hay un periodo de recepcion en curso actualmente.
                lblSinPeriodo.Text = "-- El sistema no tiene actualmente un periodo de recepción de solicitudes en curso actualmente. --";
            }
        }
开发者ID:jascrer,项目名称:Sistema_de_Inclusiones_IC-ITCR,代码行数:49,代码来源:ConsultaPeriodo.aspx.cs


示例15: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     int shoppingListID = 0;
     if (Request.QueryString["ShoppingListID"] != null && Request.QueryString["ShoppingListID"] != "")
     {
         shoppingListID = Convert.ToInt32(Request.QueryString["ShoppingListID"]);
     }
     else
     {
         Response.Redirect("ShoppingListHistory.aspx");
     }
     myConnection.ConnectionString = connstr;
     myConnection.Open();
     OleDbCommand cmd = new OleDbCommand("SELECT * FROM ShoppingList WHERE ShoppingListID = " + shoppingListID, myConnection);
     cmd.CommandType = CommandType.Text;
     OleDbDataReader reader = cmd.ExecuteReader();
     bool notEoF = reader.Read();
     while (notEoF)
     {
         lblCreatedDate.Text = reader["CreatedDate"].ToString().Split(' ')[0].ToString();
         notEoF = reader.Read();
     }
     reader.Close();
     TableHeaderRow tbHeaderRow = new TableHeaderRow();
     tbFoodItem.Rows.Add(tbHeaderRow);
     TableHeaderCell tbHeaderCellName = new TableHeaderCell();
     TableHeaderCell tbHeaderCellAmount = new TableHeaderCell();
     tbHeaderCellName.Text = "Name";
     tbHeaderCellAmount.Text = "Amount";
     tbHeaderRow.Cells.Add(tbHeaderCellName);
     tbHeaderRow.Cells.Add(tbHeaderCellAmount);
     OleDbCommand cmd2 = new OleDbCommand("SELECT * FROM FoodItem AS f INNER JOIN ShoppingListFoodItem AS sf ON f.FoodItemID = sf.FoodItemID WHERE sf.ShoppingListID = " + shoppingListID, myConnection);
     cmd2.CommandType = CommandType.Text;
     OleDbDataReader reader2 = cmd2.ExecuteReader();
     bool notEoF2 = reader2.Read();
     while (notEoF2)
     {
         TableRow tbRow = new TableRow();
         tbFoodItem.Rows.Add(tbRow);
         TableCell tbCellName = new TableCell();
         TableCell tbCellAmount = new TableCell();
         tbCellName.Text = reader2["Name"].ToString();
         tbCellAmount.Text = reader2["Amount"].ToString() + " " + reader2["UnitType"].ToString();
         tbRow.Cells.Add(tbCellName);
         tbRow.Cells.Add(tbCellAmount);
         notEoF2 = reader2.Read();
     }
     reader2.Close();
 }
开发者ID:trinhphandinhhuy,项目名称:FoodApp,代码行数:49,代码来源:ViewSPList.aspx.cs


示例16: convertButton_Click

        protected void convertButton_Click(object sender, EventArgs e)
        {
            if (IsValid)
            {
                TempTable.Visible = true;
                var StartTemp = int.Parse(startTemp.Text);
                var EndTemp = int.Parse(endTemp.Text);
                var TempStep = int.Parse(tempStep.Text);

                TableHeaderRow tableHeaderRow = new TableHeaderRow();
                TableHeaderCell tableHeaderCell = new TableHeaderCell();
                TableHeaderCell tableHeaderCellFarenheit = new TableHeaderCell();

                if (CelFa.Checked)
                {
                    CellToFar.Text = "°C";
                    FarToCell.Text = "°F";
                }
                else if (FarCe.Checked)
                {
                    CellToFar.Text = "°F";
                    FarToCell.Text = "°C";
                }
                for (int temp = StartTemp; temp <= EndTemp; temp += TempStep)
                {
                    TableCell cellOne = new TableCell();
                    TableCell cellTwo = new TableCell();
                    TableRow row = new TableRow();

                    TempTable.Rows.Add(row);
                    TempTable.Rows.Add(tableHeaderRow);

                    row.Cells.Add(cellOne);
                    row.Cells.Add(cellTwo);

                    if (CelFa.Checked == true)
                    {
                        cellOne.Text = temp.ToString();
                        cellTwo.Text = TemperatureConverter.CelsiusToFahrenheit(temp).ToString();
                    }
                    else if (FarCe.Checked == true)
                    {
                        cellOne.Text = temp.ToString();
                        cellTwo.Text = TemperatureConverter.FahrenheitToCelsius(temp).ToString();
                    }
                }
            }
        }
开发者ID:jh222vp,项目名称:vt14-1-3-konvertera-temperaturer,代码行数:48,代码来源:default.aspx.cs


示例17: CreateUserBookingTable

        public void CreateUserBookingTable()
        {
            UserName.Text = string.Format("UserName: {0}", UserDB.GetUserById(1).UserName);
            foreach (var booking in BookingDB.GetBookingsByUserId(1))
            {
                TableHeaderRow tbHeaderRow = new TableHeaderRow() { };

                TableHeaderCell tbHeaderCell = new TableHeaderCell() { Text = string.Format("<b>Booking id:</b> {0}", booking.Id), ColumnSpan = 6 };

                tbHeaderRow.Cells.Add(tbHeaderCell);
                MyBookingsTable.Rows.Add(tbHeaderRow);

                TableHeaderRow tbHeaderRowSession = new TableHeaderRow();
                tbHeaderRowSession.Cells.Add(new TableHeaderCell() { Text = "Selected" });
                tbHeaderRowSession.Cells.Add(new TableHeaderCell() { Text = "Session Id", CssClass = "no-spacing-right" });
                tbHeaderRowSession.Cells.Add(new TableHeaderCell() { Text = "Date" });
                tbHeaderRowSession.Cells.Add(new TableHeaderCell() { Text = "Time" });
                tbHeaderRowSession.Cells.Add(new TableHeaderCell() { Text = "Court" });
                tbHeaderRowSession.Cells.Add(new TableHeaderCell() { Text = "Session Cost" });
                MyBookingsTable.Rows.Add(tbHeaderRowSession);

                foreach (var session in SessionDB.GetAllSessionsByBookingId(booking.Id))
                {
                    TableRow trSession = new TableRow();
                    SessionItemCheckBox cb = new SessionItemCheckBox() {ID = session.Id.ToString() ,Session = session  };
                    TableCell tbCell = new TableCell();
                    ((IParserAccessor)tbCell).AddParsedSubObject(cb);

                    trSession.Cells.Add(tbCell);
                    trSession.Cells.Add(new TableCell() { Text = session.Id.ToString(), CssClass = "no-spacing-right" });
                    trSession.Cells.Add(new TableCell() { Text = session.StartDateTime.ToShortDateString() });
                    trSession.Cells.Add(new TableCell()
                    {
                        Text = session.StartDateTime.ToShortTimeString() + "-" + session.EndDateTime.ToShortTimeString()
                    });
                    trSession.Cells.Add(new TableCell() { Text = session.Court.Name + session.CourtId });
                    trSession.Cells.Add(new TableCell() { Text = session.SessionCost.ToString() });
                    MyBookingsTable.Rows.Add(trSession);

                }

                TableRow tbRow = new TableRow();
                tbRow.Cells.Add(new TableCell() { Text = "<hr>", ColumnSpan = 6 });

                MyBookingsTable.Rows.Add(tbRow);
            }
        }
开发者ID:Dailyman,项目名称:geckobooking,代码行数:47,代码来源:MyPage.aspx.cs


示例18: GetHeaderRow

        private TableHeaderRow GetHeaderRow()
        {
            using (TableHeaderRow row = new TableHeaderRow())
            {
                row.TableSection = TableRowSection.TableHeader;

                row.Cells.Add(this.GetHeaderCell(Titles.Type, "TransactionTypeSelect", false, 80));
                row.Cells.Add(this.GetHeaderCell(Titles.Store, "StoreSelect", false, 140));
                row.Cells.Add(this.GetHeaderCell(Titles.ItemCode, "ItemCodeInputText", false, 90));
                row.Cells.Add(this.GetHeaderCell(Titles.ItemName, "ItemSelect", false, 0));
                row.Cells.Add(this.GetHeaderCell(Titles.Unit, "UnitSelect", false, 120));
                row.Cells.Add(this.GetHeaderCell(Titles.Quantity, "QuantityInputText", true, 120));
                row.Cells.Add(this.GetHeaderCell(Titles.Action, null, false, 120));

                return row;
            }
        }
开发者ID:JonathanValle,项目名称:mixerp,代码行数:17,代码来源:GridPanel.cs


示例19: InstantiateTitles

        /// <summary>
        /// instantiate labels and expand button
        /// </summary>
        /// <param name="parent">control to instantiate in</param>
        private static void InstantiateTitles(Control parent)
        {
            TableHeaderRow labelsRow = new TableHeaderRow();
            labelsRow.ID = PatientBannerControlIds.ZoneTwoPermanent;

            WebControl subsectionOne = InstantiateTitle(labelsRow, PatientBannerControlIds.SubsectionOneTitle);
            WebControl subsectionTwo = InstantiateTitle(labelsRow, PatientBannerControlIds.SubsectionTwoTitle);
            InstantiateTitle(labelsRow, PatientBannerControlIds.SubsectionThreeTitle);
            InstantiateTitle(labelsRow, PatientBannerControlIds.SubsectionFourTitle);
            WebControl subsectionFive = InstantiateImageTitle(labelsRow, PatientBannerControlIds.SubsectionFive, PatientBannerControlIds.SubsectionFiveTitle, PatientBannerControlIds.AllergyIcon);
            InstantiateExpandImage(labelsRow);
            InstantiateAddressSummary(subsectionOne);
            InstantiateContactDetailsSummary(subsectionTwo);
            InstantiateAllergySummary(subsectionFive);

            parent.Controls.Add(labelsRow);
        }
开发者ID:rbirkby,项目名称:mscui,代码行数:21,代码来源:PatientBannerZoneTwoTemplate.cs


示例20: lookup

        void lookup()
        {
            DataGetter dataGetter = new DataGetter();

            List<DateTime> departs = dataGetter.Depart;
            List<DateTime> arrives = dataGetter.Arrive;

            TableTimes.Rows.Clear ();
            TableHeaderRow hRow = new TableHeaderRow ();
            TableTimes.Rows.Add (hRow);

            if (departs.Count == 0 || arrives.Count == 0) {
                TableHeaderCell cell = new TableHeaderCell ();
                cell.Text = "No Trains Found";
                cell.CssClass = "text-center";
                hRow.Cells.Add (cell);
                hRow.CssClass = "danger";
            } else {
                TableHeaderCell departHeaderCell = new TableHeaderCell ();
                departHeaderCell.Text = "Depart";
                departHeaderCell.CssClass = "text-center";
                hRow.Cells.Add (departHeaderCell);
                TableHeaderCell arriveHeaderCell = new TableHeaderCell ();
                arriveHeaderCell.Text = "Arrive";
                arriveHeaderCell.CssClass = "text-center";
                hRow.Cells.Add (arriveHeaderCell);

                for (int i = 0; i < departs.Count && i < arrives.Count; i++) {
                    if (Trip.Day > 0 || (Trip.Day == 0 && departs [i] > DateTime.Now)) {
                        TableCell departCell = new TableCell ();
                        departCell.Text = departs [i].ToShortTimeString ();
                        departCell.CssClass = "text-center";
                        TableCell arriveCell = new TableCell ();
                        arriveCell.Text = arrives [i].ToShortTimeString ();
                        arriveCell.CssClass = "text-center";
                        TableRow row = new TableRow ();
                        row.Cells.Add (departCell);
                        row.Cells.Add (arriveCell);
                        TableTimes.Rows.Add (row);
                    }
                }
            }
        }
开发者ID:vipuldelwadia,项目名称:Wellington-Trains-Website,代码行数:43,代码来源:Default.aspx.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# WebControls.TableItemStyle类代码示例发布时间:2022-05-26
下一篇:
C# WebControls.TableHeaderCell类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap