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


C# CheckBoxList.DataBind方法代码示例

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


在下文中一共展示了CheckBoxList.DataBind方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ChkListFill

 public static void ChkListFill(ref CheckBoxList chkl, object list)
 {
     chkl.DataTextField = listDefaultDataTextField;
     chkl.DataValueField = listDefaultDataValueField;
     chkl.DataSource = list;
     chkl.DataBind();
 }
开发者ID:aleks19921015,项目名称:Service,代码行数:7,代码来源:MainHelper.cs

示例2: setCheckBoxList

 public void setCheckBoxList(CheckBoxList chl, DataSet ds, string display, string value)
 {
     chl.DataSource = ds;
     chl.DataTextField = display;
     chl.DataValueField = value;
     chl.DataBind();
 }
开发者ID:axelander95,项目名称:CFT,代码行数:7,代码来源:Database.cs

示例3: MultipleSelectControl

        public MultipleSelectControl(MultipleSelect item, RepeatDirection direction)
        {
            this.item = item;

            l = new Label();
            l.Text = item.Title;
            l.CssClass = "label";
            l.AssociatedControlID = item.Name;
            this.Controls.Add(l);

            list = new CheckBoxList();
            list.RepeatDirection = direction;
            list.ID = item.Name;
            list.CssClass = "alternatives";
            list.DataSource = item.GetChildren();
            list.DataTextField = "Title";
            list.DataValueField = "ID";
            list.DataBind();
            this.Controls.Add(list);

            if (item.Required)
            {
                cv = new CustomValidator { Display = ValidatorDisplay.Dynamic, Text = "*" };
                cv.ErrorMessage = item.Title + " is required";
                cv.ServerValidate += (s, a) => a.IsValid = !string.IsNullOrEmpty(AnswerText);
                cv.ValidationGroup = "Form";
                this.Controls.Add(cv);
            }
        }
开发者ID:Jobu,项目名称:n2cms,代码行数:29,代码来源:MultipleSelectControl.cs

示例4: populate

 public static void populate(CheckBoxList element, int id_equipe)
 {
     element.DataSource = controller().find_by_equipe(id_equipe);
     element.AppendDataBoundItems = true;
     element.DataTextField = "nome";
     element.DataValueField = "id";
     element.DataBind();
 }
开发者ID:eliasdevelop,项目名称:sgbf,代码行数:8,代码来源:JogadorHelper.cs

示例5: FillCheckBoxList

 public void FillCheckBoxList(CheckBoxList chk, DataTable mydt, string textField, string valueFeild)
 {
     chk.DataSource = mydt;
     chk.DataValueField = valueFeild;
     chk.DataTextField = textField;
     chk.DataBind();
     chk.Items.Insert(0, new ListItem { Value = "0", Text = "All", Selected = false });
 }
开发者ID:NetworksAuro,项目名称:Networks,代码行数:8,代码来源:RouteReport.aspx.cs

示例6: populateCheckbox

 public static void populateCheckbox(CheckBoxList element)
 {
     element.DataSource = controller().index();
     element.AppendDataBoundItems = true;
     element.DataTextField = "nom_disc";
     element.DataValueField = "id";
     element.DataBind();
 }
开发者ID:eliasdevelop,项目名称:acadcontrol,代码行数:8,代码来源:DisciplinaHelper.cs

示例7: FillCheckBoxList

        public void FillCheckBoxList(ref CheckBoxList objchkList, string strQuery, string strTextField, string strValueField, string strOrderBy, string strQueryCondition = "")
        {
            dsCommon = new DataSet();
            dsCommon = CrystalConnection.CreateDatasetWithoutTransaction(strQuery + " " + strQueryCondition + " " + strOrderBy);

            objchkList.DataTextField = strTextField;
            objchkList.DataValueField = strValueField;
            objchkList.DataSource = dsCommon.Tables[0].DefaultView;
            objchkList.DataBind();
        }
开发者ID:AAGJKPRT,项目名称:LMT,代码行数:10,代码来源:csDropDownFunction.cs

示例8: AllSizes

 /// <summary>
 /// Load All Sizes in CheckBox Collections.
 /// </summary>
 public static void AllSizes(CheckBoxList SizeschkBxs, List<StyleSize> sizes=null)
 {
     List<Size> sizes_list = SM.Sizes();
     if (sizes == null)
     {
         SizeschkBxs.DataSource = SM.Sizes();
         SizeschkBxs.DataValueField = "SizeCode";
         SizeschkBxs.DataTextField = "SizeDescription";
         SizeschkBxs.DataBind();
     }
     else
     {
         var results = (from size in sizes_list
                        join s_size in sizes on size.SizeCode  equals s_size.SizeCode
                        select size).ToList<Size>();
         SizeschkBxs.DataSource = sizes_list.Except(results);
         SizeschkBxs.DataValueField = "SizeCode";
         SizeschkBxs.DataTextField = "SizeDescription";
         SizeschkBxs.DataBind();
     }
 }
开发者ID:DennisPitallano,项目名称:IRMS-MARKETING,代码行数:24,代码来源:Populate.cs

示例9: AllColors

        /// <summary>
        /// Load All Colors in CheckBox Collections.
        /// </summary>
        public static void AllColors(CheckBoxList ColorchkBx, List<StyleColor> colors= null)
        {
            List<Color> color_list = CM.Colors();
            if (colors == null)
            {
                ColorchkBx.DataSource = CM.Colors();
                ColorchkBx.DataValueField = "ColorCode";
                ColorchkBx.DataTextField = "ColorDescription";
                ColorchkBx.DataBind();
            }
            else
            {
                var results = (from color in color_list
                             join s_color in colors on color.ColorCode equals s_color.ColorCode
                             select color).ToList<Color>();

                ColorchkBx.DataSource = color_list.Except(results);
                ColorchkBx.DataValueField = "ColorCode";
                ColorchkBx.DataTextField = "ColorDescription";
                ColorchkBx.DataBind();
            }
        }
开发者ID:DennisPitallano,项目名称:IRMS-MARKETING,代码行数:25,代码来源:Populate.cs

示例10: FillDataToCheckboxList

 public static void FillDataToCheckboxList(CheckBoxList control, string table, string dataTextField, string dataValueField)
 {
     OpenData();
     string strCommand = "SELECT " + dataTextField + ", " + dataValueField + " FROM " + table;
     da = new SqlDataAdapter(strCommand, con);
     ds = new DataSet();
     da.Fill(ds, strCommand);
     control.DataSource = ds;
     control.DataTextField = dataTextField;
     control.DataValueField = dataValueField;
     control.DataBind();
     CloseData();
 }
开发者ID:salahmyn,项目名称:galileovietnam,代码行数:13,代码来源:ListControlUtilities.cs

示例11: FillDataToCheckBoxList

 public static void FillDataToCheckBoxList(CheckBoxList control, string table, string dataTextField, string dataValueField)
 {
     opendata();
     string strCommand = "SELECT " + dataTextField + ", " + dataValueField + " FROM " + table;
     sqladapter = new SqlDataAdapter(strCommand, sqlconn);
     mydata = new DataSet();
     sqladapter.Fill(mydata, strCommand);
     control.DataSource = mydata;
     control.DataTextField = dataTextField;
     control.DataValueField = dataValueField;
     control.DataBind();
     closedata();
 }
开发者ID:salahmyn,项目名称:galileovietnam,代码行数:13,代码来源:ListControlHelper.cs

示例12: Concessionaria

        public static void Concessionaria(CheckBoxList ck)
        {
            try
            {
                ck.DataSource = CRB.BOSS.Autenticacao.Concessionaria.Concessionaria.CarregarConcessionariasAutenticadas();
                ck.DataValueField = "ID";
                ck.DataTextField = "Nome";
                ck.DataBind();

                CRB.BOSS.Auditoria.Log.Log.Salvar("Carregar CheckBoxList de Concessionaria", CRB.BOSS.Auditoria.Log.InformacoesLog.Information, CRB.BOSS.Autenticacao.Modulo.Modulo.Funcionalidade, CRB.BOSS.Autenticacao.Modulo.Modulo.Atual);
            }
            catch (Exception ex)
            {
                CRB.BOSS.Auditoria.Log.Log.Salvar(ex.Message, CRB.BOSS.Auditoria.Log.InformacoesLog.Information, CRB.BOSS.Autenticacao.Modulo.Modulo.Funcionalidade, CRB.BOSS.Autenticacao.Modulo.Modulo.Atual);

                throw ex;
            }
        }
开发者ID:KleberRibeiro89,项目名称:d5solucoes,代码行数:18,代码来源:Checkbox.cs

示例13: StationOfChannelBind

        /// <summary>
        /// 
        /// </summary>
        /// <param name="channelID"></param>
        /// <param name="cblStation"></param>
        /// <param name="deviceTypes"></param>
        /// <param name="isSelected"></param>
        public static void StationOfChannelBind(int channelID, CheckBoxList cblStation, string[] deviceTypes, bool isSelected)
        {
            ChannelClass ch = ChannelFactory.CreateChannel(channelID);
            if (ch != null)
            {
                StationCollection sts = ch.StationCollection.GetStationCollection(deviceTypes);

                ListItemCollection stationList = GetStationListItemCollection(sts);
                cblStation.DataTextField = "Text";
                cblStation.DataValueField = "Value";
                cblStation.DataSource = stationList;
                cblStation.DataBind();

                foreach (ListItem stitem in cblStation.Items)
                {
                    stitem.Selected = isSelected;
                }
            }
        }
开发者ID:hkiaipc,项目名称:yh,代码行数:26,代码来源:OrganizationDataBinder.cs

示例14: FillToCheckBoxList

 public void FillToCheckBoxList(CheckBoxList checkboxlist, DataTable datatable, string displayMember, string valueMember)
 {
     if (datatable != null)
     {
         checkboxlist.DataSource = datatable;
         checkboxlist.DataTextField = displayMember;
         checkboxlist.DataValueField = valueMember;
     }
     else
     {
         checkboxlist.DataSource = null;
     }
     checkboxlist.DataBind();
 }
开发者ID:trungjc,项目名称:quanlyhocsinh,代码行数:14,代码来源:commonBSO.cs

示例15: LoadCheckBoxList

        public static bool LoadCheckBoxList(CheckBoxList _CheckBoxList, object objData, string dataTextField,
            string dataValueField)
        {
            if (objData != null)
            {
                _CheckBoxList.DataSource = null;
                _CheckBoxList.Items.Clear();

                _CheckBoxList.DataSource = objData;
                _CheckBoxList.DataTextField = dataTextField;
                _CheckBoxList.DataValueField = dataValueField;

                try
                {
                    _CheckBoxList.DataBind();
                }
                catch
                {
                    return false;
                }
                return true;
            }
            return false;
        }
开发者ID:preguntoncojonero,项目名称:test,代码行数:24,代码来源:ISWeb.cs


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