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

C# HtmlControls.HtmlInputCheckBox类代码示例

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

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



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

示例1: InstantiateIn

		/// <summary>
		/// 
		/// </summary>
		/// <param name="container"></param>
		public void InstantiateIn(Control container)
		{
			switch (this.templateType)
			{
				case DataControlRowType.Header:
					htmlControls.HtmlInputCheckBox checkBoxAll = new htmlControls.HtmlInputCheckBox();
					checkBoxAll.ID = "checkall";
					checkBoxAll.Name = this.checkItemName;
					checkBoxAll.Value = "选全";
					container.Controls.Add(checkBoxAll);

					if (this.isMultiSelect == false)
						checkBoxAll.Style["display"] = "none";

					break;
				case DataControlRowType.DataRow:
					InputButton checkBox = new InputButton();

					checkBox.Name = this.checkItemName;
					checkBox.ID = "checkitem";

					if (this.isMultiSelect)
						checkBox.ButtonType = InputButtonType.CheckBox;
					else
						checkBox.ButtonType = InputButtonType.Radio;

					checkBox.Value = "";
					container.Controls.Add(checkBox);
					break;
			}
		}
开发者ID:jerryshi2007,项目名称:AK47Source,代码行数:35,代码来源:CheckBoxTemplate.cs


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


示例3: AddCashTransactionDivField

        private void AddCashTransactionDivField(HtmlGenericControl container)
        {
            using (HtmlGenericControl field = HtmlControlHelper.GetField())
            {
                using (HtmlGenericControl label = HtmlControlHelper.GetLabel("&nbsp;"))
                {
                    field.Controls.Add(label);
                }

                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);
                    }

                    field.Controls.Add(toggleCheckBox);
                }

                container.Controls.Add(field);
            }
        }
开发者ID:abinabrahamanchery,项目名称:mixerp,代码行数:30,代码来源:CashTransaction.cs


示例4: AddCompactCheckBoxField

        private void AddCompactCheckBoxField(HtmlGenericControl container)
        {
            using (HtmlGenericControl field = HtmlControlHelper.GetField())
            {
                using (HtmlGenericControl slider = new HtmlGenericControl("div"))
                {
                    slider.Attributes.Add("class", "ui checkbox");

                    using (HtmlInputCheckBox checkBox = new HtmlInputCheckBox())
                    {
                        checkBox.ID = "CompactCheckBox";
                        checkBox.Checked = false;

                        slider.Controls.Add(checkBox);
                        this.isCompactHidden = new HiddenField();
                        this.isCompactHidden.ID = "IsCompactHidden";
                        this.isCompactHidden.Value = "0";

                        slider.Controls.Add(this.isCompactHidden);
                    }

                    using (HtmlGenericControl label = HtmlControlHelper.GetLabel(Titles.ShowCompact))
                    {
                        slider.Controls.Add(label);
                    }

                    field.Controls.Add(slider);
                }

                container.Controls.Add(field);
            }
        }
开发者ID:roczj,项目名称:mixerp,代码行数:32,代码来源:ProfitAndLossAccount.ascx.cs


示例5: AddCheckBox

		void AddCheckBox(string option)
		{
			HtmlInputCheckBox cb = new HtmlInputCheckBox();
			Controls.Add(cb);
			cb.ID = option;
			cb.Attributes["onchange"] = string.Format("AnthemDebugger_Debug{0} = this.checked", option);
			Controls.Add(new LiteralControl(string.Format(" {0} ", option)));
		}
开发者ID:thetownfool,项目名称:anthemnxt,代码行数:8,代码来源:Debugger.cs


示例6: DefaultProperties

		public void DefaultProperties ()
		{
			HtmlInputCheckBox c = new HtmlInputCheckBox ();
		
			Assert.AreEqual (1, c.Attributes.Count, "Attributes.Count");

			Assert.IsFalse (c.Checked, "Checked");
			
			Assert.AreEqual (1, c.Attributes.Count, "Attributes.Count after");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:10,代码来源:HtmlInputCheckBoxTest.cs


示例7: CleanProperties

		public void CleanProperties ()
		{
			HtmlInputCheckBox c = new HtmlInputCheckBox ();

			c.Checked = true;
			Assert.AreEqual (2, c.Attributes.Count, "Attributes.Count");

			c.Checked = false;
			Assert.AreEqual (1, c.Attributes.Count, "Attributes.Count after");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:10,代码来源:HtmlInputCheckBoxTest.cs


示例8: lbtDelete_Click

        protected void lbtDelete_Click(object sender, EventArgs e)
        {
            int i = 0;
            int j = 0;

            HtmlInputCheckBox check = new HtmlInputCheckBox();

            int[] items = new int[rptList.Items.Count];

            try
            {
                foreach (RepeaterItem item in rptList.Items)
                {
                    check = new HtmlInputCheckBox();
                    check = (HtmlInputCheckBox)item.FindControl("chkSelect");
                    Label lblID = (Label)item.FindControl("lblID");

                    if (check.Checked)
                    {
                        int catId = Utils.CIntDef(lblID.Text, 0);
                        items[j] = catId;
                        try
                        {
                            //delete folder
                            string fullpath = Server.MapPath(PathFiles.GetPathNews(items[j]));
                            if (Directory.Exists(fullpath))
                            {
                                DeleteAllFilesInFolder(fullpath);
                                Directory.Delete(fullpath);
                            }
                        }
                        catch (Exception)
                        { }
                        j++;
                    }

                    i++;
                }

                //delete
                var g_delete = DB.GetTable<ESHOP_AD_ITEM>().Where(g => items.Contains(g.AD_ITEM_ID));

                DB.ESHOP_AD_ITEMs.DeleteAllOnSubmit(g_delete);
                DB.SubmitChanges();
            }
            catch (Exception ex)
            {
                clsVproErrorHandler.HandlerError(ex);
            }
            finally
            {
                items = null;
                SearchResult();
            }
        }
开发者ID:htphongqn,项目名称:kibitravel,代码行数:55,代码来源:aditem_list.aspx.cs


示例9: NullProperties

		public void NullProperties ()
		{
			HtmlInputCheckBox c = new HtmlInputCheckBox ();
			
			Assert.AreEqual (1, c.Attributes.Count, "Attributes.Count");
			Assert.AreEqual ("checkbox", c.Attributes["type"], "Attributes[\"type\"]");
			
			c.Checked = true;
			Assert.IsTrue (c.Checked, "Checked");
			
			Assert.AreEqual (2, c.Attributes.Count, "Attributes.Count after");
			Assert.AreEqual ("checked", c.Attributes["checked"], "Attributes[\"checked\"]");
		}
开发者ID:Profit0004,项目名称:mono,代码行数:13,代码来源:HtmlInputCheckBoxTest.cs


示例10: SaveNewsCat

        private void SaveNewsCat()
        {
            string strLink = "";

            try
            {
                int i = 0;
                HtmlInputCheckBox check = new HtmlInputCheckBox();

                var gcdel = (from gp in DB.ESHOP_NEWS_CATs
                             where gp.NEWS_ID == m_news_id
                             select gp);

                DB.ESHOP_NEWS_CATs.DeleteAllOnSubmit(gcdel);

                foreach (RepeaterItem item in rptList.Items)
                {
                    check = new HtmlInputCheckBox();
                    check = (HtmlInputCheckBox)item.FindControl("chkSelect");
                    Label lblID = (Label)item.FindControl("lblID");

                    if (check.Checked)
                    {
                        int _Id = Utils.CIntDef(lblID.Text, 0);
                        ESHOP_NEWS_CAT grinsert = new ESHOP_NEWS_CAT();
                        grinsert.CAT_ID = _Id;
                        grinsert.NEWS_ID = m_news_id;

                        DB.ESHOP_NEWS_CATs.InsertOnSubmit(grinsert);
                    }

                    i++;
                }

                DB.SubmitChanges();
                strLink = "news.aspx?news_id=" + m_news_id;
            }
            catch (Exception ex)
            {
                clsVproErrorHandler.HandlerError(ex);
            }
            finally
            {
                if (!string.IsNullOrEmpty(strLink))
                    Response.Redirect(strLink);
            }
        }
开发者ID:htphongqn,项目名称:websitegiaoxu,代码行数:47,代码来源:news_category.aspx.cs


示例11: InstantiateIn

            public void InstantiateIn(Control container)
            {
                using (HtmlGenericControl toggleCheckBox = new HtmlGenericControl("div"))
                {
                    toggleCheckBox.Attributes.Add("class", "ui toggle checkbox");

                    using (HtmlInputCheckBox checkBox = new HtmlInputCheckBox())
                    {
                        toggleCheckBox.Controls.Add(checkBox);
                    }

                    using (HtmlGenericControl label = new HtmlGenericControl("label"))
                    {
                        toggleCheckBox.Controls.Add(label);
                    }

                    container.Controls.Add(toggleCheckBox);
                }
            }
开发者ID:JonathanValle,项目名称:mixerp,代码行数:19,代码来源:GridViewHelper.cs


示例12: lbtDelete_Click

        protected void lbtDelete_Click(object sender, EventArgs e)
        {
            int i = 0;
            int j = 0;
            HtmlInputCheckBox check = new HtmlInputCheckBox();
            int[] items = new int[rptList.Items.Count];

            try
            {
                foreach (RepeaterItem item in rptList.Items)
                {
                    check = new HtmlInputCheckBox();
                    check = (HtmlInputCheckBox)item.FindControl("chkSelect");
                    Label lblID = (Label)item.FindControl("lblID");

                    if (check.Checked)
                    {
                        int catId = Utils.CIntDef(lblID.Text, 0);
                        items[j] = catId;
                        j++;
                    }

                    i++;
                }

                //delete
                var g_delete = DB.GetTable<ESHOP_CATEGORy>().Where(g => items.Contains(g.CAT_ID));

                DB.ESHOP_CATEGORies.DeleteAllOnSubmit(g_delete);
                DB.SubmitChanges();
            }
            catch (Exception ex)
            {
                clsVproErrorHandler.HandlerError(ex);
            }
            finally
            {
                items = null;
                //SearchResult();
            }

            Response.Redirect("category_list.aspx");
        }
开发者ID:htphongqn,项目名称:ecobuild,代码行数:43,代码来源:category_list.aspx.cs


示例13: lbtDelete_Click

        protected void lbtDelete_Click(object sender, EventArgs e)
        {
            int i = 0;
            int j = 0;

            HtmlInputCheckBox check = new HtmlInputCheckBox();

            int[] items = new int[GridItemList.Items.Count];

            try
            {
                foreach (DataGridItem item in GridItemList.Items)
                {
                    check = new HtmlInputCheckBox();
                    check = (HtmlInputCheckBox)item.Cells[1].FindControl("chkSelect");

                    if (check.Checked)
                    {
                        items[j] = Utils.CIntDef(GridItemList.DataKeys[i]);

                        j++;
                    }

                    i++;
                }

                //delete 
                var g_delete = db.GetTable<BAOHANH>().Where(g => items.Contains(g.ID));

                db.BAOHANHs.DeleteAllOnSubmit(g_delete);
                db.SubmitChanges();
            }
            catch (Exception ex)
            {
                clsVproErrorHandler.HandlerError(ex);
            }
            finally
            {
                items = null;
                loadListBaohanh();
            }

        }
开发者ID:htphongqn,项目名称:ketnoitructuyen.com,代码行数:43,代码来源:danh-sach-bao-hanh.aspx.cs


示例14: SaveNewsCat

        private void SaveNewsCat()
        {
            string strLink = "";

            try
            {
                HtmlInputCheckBox check = new HtmlInputCheckBox();

                var gcdel = (from gp in DB.ESHOP_NEWS_CATs
                             where gp.NEWS_ID == m_news_id
                             select gp);

                DB.ESHOP_NEWS_CATs.DeleteAllOnSubmit(gcdel);
                for (int i = 0; i < Rplistcate.Items.Count; i++)
                {
                    check = new HtmlInputCheckBox();
                    check = (HtmlInputCheckBox)Rplistcate.Items[i].FindControl("chkSelect");
                    HiddenField Hdid = Rplistcate.Items[i].FindControl("Hdcatid") as HiddenField;
                    int _catid = Utils.CIntDef(Hdid.Value);
                    if (check.Checked)
                    {
                        ESHOP_NEWS_CAT grinsert = new ESHOP_NEWS_CAT();
                        grinsert.CAT_ID = _catid;
                        grinsert.NEWS_ID = m_news_id;
                        DB.ESHOP_NEWS_CATs.InsertOnSubmit(grinsert);
                    }
                }
               

                DB.SubmitChanges();
                strLink = "news.aspx?news_id=" + m_news_id;
            }
            catch (Exception ex)
            {
                clsVproErrorHandler.HandlerError(ex);
            }
            finally
            {
                if (!string.IsNullOrEmpty(strLink))
                    Response.Redirect(strLink);
            }
        }
开发者ID:htphongqn,项目名称:esell.yeuthietkeweb.com,代码行数:42,代码来源:news_category.aspx.cs


示例15: RenderDivShowHide

        private void RenderDivShowHide(HtmlTextWriter writer)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Class, "itemlistcontainer");
            writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ClientID + "_DivShowHide");
            writer.AddAttribute("itemalign", ItemAlign.ToString());
            writer.AddAttribute(HtmlTextWriterAttribute.Style, "display: none; z-index: 500;");

            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            writer.AddAttribute(HtmlTextWriterAttribute.Style, "padding: 5px;");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            RenderCheckBoxDiv(writer);
            writer.RenderEndTag();

            writer.AddAttribute(HtmlTextWriterAttribute.Class, "divconfirm");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            if (ShowCheckAll && SingleMode == SingledType.NotSet)
            {
                HtmlInputCheckBox cb = new HtmlInputCheckBox();
                cb.ID = this.ClientID + "_SelectAll";
                cb.Attributes.Add("onclick", "CheckBoxSelectAll('" + this.ClientID + "');");
                cb.RenderControl(writer);

                writer.AddAttribute("for", this.ClientID + "_SelectAll");
                writer.RenderBeginTag(HtmlTextWriterTag.Label);
                writer.Write("全选 ");
                writer.RenderEndTag();
                writer.Write(" ");
            }

            HtmlInputButton confirm = new HtmlInputButton();
            confirm.Value = "确 定";
            confirm.Attributes.Add("class", "btn");
            confirm.Attributes.Add("onclick", "CheckBoxListConfirm('" + this.ClientID + "'); HideComboBoxDiv('" + this.ClientID + "');");
            confirm.RenderControl(writer);

            writer.Write(" ");

            HtmlInputButton cancel = new HtmlInputButton();
            cancel.Value = "取 消";
            cancel.Attributes.Add("class", "btn");
            cancel.Attributes.Add("onclick", "HideComboBoxDiv('" + this.ClientID + "');");
            cancel.RenderControl(writer);

            writer.RenderEndTag();
            writer.RenderEndTag();
        }
开发者ID:dollarsxu,项目名称:ComboBox,代码行数:48,代码来源:CheckBoxExtend.cs


示例16: lbtSave_Click

        protected void lbtSave_Click(object sender, EventArgs e)
        {
            HtmlInputCheckBox check = new HtmlInputCheckBox();
            string strLink = "";
            int i = 0;

            try
            {
                foreach (DataGridItem item in GridItemList.Items)
                {
                    check = new HtmlInputCheckBox();
                    check = (HtmlInputCheckBox)item.Cells[1].FindControl("chkSelect");

                    if (check.Checked)
                    {
                        strLink = "units.aspx?unit_id=" + Utils.CStrDef(GridItemList.DataKeys[i]);
                        break;
                    }
                    i++;
                }

            }
            catch (Exception ex)
            {
                clsVproErrorHandler.HandlerError(ex);
            }
            finally
            {
                if (!string.IsNullOrEmpty(strLink))
                    Response.Redirect(strLink);
            }

        }
开发者ID:htphongqn,项目名称:dichvuviettel.com.vn,代码行数:33,代码来源:units_list.aspx.cs


示例17: SaveGroupCat

        private void SaveGroupCat(int GroupId)
        {
            try
            {
                int i = 0;
                HtmlInputCheckBox check = new HtmlInputCheckBox();

                var gcdel = (from gp in DB.ESHOP_GROUP_CATs
                              where gp.GROUP_ID == GroupId
                              select gp);
                DB.ESHOP_GROUP_CATs.DeleteAllOnSubmit(gcdel);

                foreach (DataGridItem item in GridItemList.Items)
                {
                    check = new HtmlInputCheckBox();
                    check = (HtmlInputCheckBox)item.Cells[1].FindControl("chkSelect");

                    if (check.Checked)
                    {
                        ESHOP_GROUP_CAT grinsert = new ESHOP_GROUP_CAT();
                        grinsert.CAT_ID=Utils.CIntDef(GridItemList.DataKeys[i]);
                        grinsert.GROUP_ID = GroupId;

                        DB.ESHOP_GROUP_CATs.InsertOnSubmit(grinsert);
                    }

                    i++;
                }

                //DB.SubmitChanges();

            }
            catch (Exception ex)
            {
                clsVproErrorHandler.HandlerError(ex);
            }
        }
开发者ID:htphongqn,项目名称:truongcaodangngheytebinhduong,代码行数:37,代码来源:groups.aspx.cs


示例18: InitializeChecklists

        /// <summary>
        /// Initializes the checklists. Checklists provides additional search result filtering functionality.
        /// It's stored in the catalog settings folder.
        /// </summary>
        /// <param name="checklists">The checklists.</param>
        public void InitializeChecklists(IEnumerable<ChecklistDefinition> checklists)
        {
            this.Checklists = new NameValueCollection();

              foreach (var checklist in checklists)
              {
            var args = new ChecklistEventArgs { ChecklistDefinition = checklist };
            this.OnChecklistCreating(args);

            var border = new Border();
            border.Attributes["class"] = "scChecklist";
            this.ChecklistContainer.Controls.Add(border);

            var header = new Border { ID = Control.GetUniqueID("ChecklistHeader"), InnerHtml = checklist.Header };
            header.Attributes["class"] = "scChecklistHeader";
            border.Controls.Add(header);

            var checklistBorder = new Border { ID = Control.GetUniqueID("ChecklistBody") };
            checklistBorder.Attributes["name"] = CheckListIdPrefix + checklist.Field;
            checklistBorder.Attributes["class"] = "scChecklistItems";
            border.Controls.Add(checklistBorder);

            foreach (var checklistItem in checklist.Checkboxes)
            {
              var cb = new HtmlInputCheckBox { ID = string.Concat(Control.GetUniqueID("checkbox_"), CheckListIdPrefix, checklist.Field), Checked = args.CheckedValues != null && args.CheckedValues.Contains(checklistItem.Value), Value = checklistItem.Value };
              checklistBorder.Controls.Add(cb);

              var label = new LiteralControl(string.Format("<label for=\"{0}\">{1}</label><br />", cb.ClientID, checklistItem.Text));
              checklistBorder.Controls.Add(label);

              if (cb.Checked)
              {
            AddListStringValue(this.Checklists, checklist.Field, checklistItem.Value);
              }
            }
              }
        }
开发者ID:HydAu,项目名称:sitecore8ecommerce,代码行数:42,代码来源:CatalogView.cs


示例19: lbtDelete_Click

        protected void lbtDelete_Click(object sender, EventArgs e)
        {
            int i = 0;
            int j = 0;
            HtmlInputCheckBox check = new HtmlInputCheckBox();
            int[] items = new int[GridItemList.Items.Count];

            try
            {
                foreach (DataGridItem item in GridItemList.Items)
                {
                    check = new HtmlInputCheckBox();
                    check = (HtmlInputCheckBox)item.Cells[1].FindControl("chkSelect");

                    if (check.Checked)
                    {
                        items[j] = Utils.CIntDef(GridItemList.DataKeys[i]);
                        j++;
                    }

                    i++;
                }

                //delete 
                var g_delete = DB.GetTable<ESHOP_PROPERTy>().Where(g => items.Contains(Convert.ToInt32(g.PROP_ID)));

                DB.ESHOP_PROPERTies.DeleteAllOnSubmit(g_delete);
                DB.SubmitChanges();
            }
            catch (Exception ex)
            {
                clsVproErrorHandler.HandlerError(ex);
            }
            finally
            {
                items = null;
                SearchResult();
            }

        }
开发者ID:htphongqn,项目名称:dichvuviettel.com.vn,代码行数:40,代码来源:area_list.aspx.cs


示例20: CreateTable

        private void CreateTable()
        {
            if(this.DataSource==null)
                return;

            TableRow row;
            TableCell cell;
            HtmlInputRadioButton radio;
            HtmlInputCheckBox chkbox;

            int currentPage=this.CurrentPage;

            if(EnablePages==false)
                PageSize=DataSource.Rows.Count;

            int startIndex=this.CurrentPage*PageSize-PageSize;
            int endIndex=this.CurrentPage*PageSize-1;

            if(endIndex>=DataSource.DefaultView.Count)
                endIndex=DataSource.DefaultView.Count-1;

            if(startIndex>endIndex)
                if(endIndex+1>PageSize)
                {
                    startIndex=0;
                    endIndex=PageSize-1;
                }
                else
                {
                    startIndex=0;
                    //endIndex is same
                }

            for(int rowIndex=startIndex ; rowIndex<=endIndex ; rowIndex++)
            {
                row=new TableRow();
                //first column

                cell=new TableCell();
                cell.CssClass="tbl1_chk";
                cell.Visible=false;

                if(EnableCheckBoxes==true)
                {
                    cell.Visible=true;
                    //string primaryKeyString=string.Join(_primaryKeySeparator, this.PrimaryKeyColumnArray);
                    string primaryKeyValue="";
                    for(int i=0;i<this.PrimaryKeyColumnArray.Length;i++)
                    {
                        if(i!=0)
                            primaryKeyValue+=_primaryKeySeparator;
                        primaryKeyValue+=DataSource.DefaultView[rowIndex][this.PrimaryKeyColumnArray[i].ToString()].ToString();
                    }

                    if(EnableMultipleSelection==false)
                    {

                        radio=new HtmlInputRadioButton();
                        radio.Name="chk_";
                        radio.Value=primaryKeyValue;
                        radio.EnableViewState=false;
                        cell.Controls.Add(radio);
                    }
                    else
                    {
                        chkbox=new HtmlInputCheckBox();
                        chkbox.Name=this.UniqueID;
                        chkbox.Value=primaryKeyValue;
                        chkbox.ID="chk_" + rowIndex.ToString();
                        chkbox.EnableViewState=false;
                        cell.Controls.Add(chkbox);
                    }

                }

                row.Cells.Add(cell);

                for(int i=0;i<this.ColumnNameArray.Length;i++)
                {
                    string columnName=this.ColumnNameArray[i];
                    int columnWidth=this.ColumnWidthArray[i];

                    if (columnWidth<=0)
                    {
                        continue;	//we're not displaying curDSColumn
                    }

                    cell=new TableCell();
                    cell.CssClass="tbl1_item";
                    CreateTableCell(cell , columnName , rowIndex , DataSource.DefaultView[rowIndex].Row);
                    row.Cells.Add(cell);
                }
                GridTable.Rows.Add(row);
            }
        }
开发者ID:GermanGlushkov,项目名称:FieldInformer,代码行数:95,代码来源:FIDataTableGrid.ascx.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# HtmlControls.HtmlInputText类代码示例发布时间:2022-05-26
下一篇:
C# HtmlControls.HtmlInputButton类代码示例发布时间: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