zoukankan      html  css  js  c++  java
  • c# 绑定checkboxlist 数据库的值函数

    public void BindCheckBoxList(CheckBoxList cbl, bool isText, string values)
            {
                values = string.IsNullOrEmpty(values) ? ("") : (values);
                if (values.Length > 0)
                {
                    if (isText)
                    {
                        string[] tempValues = values.Split(',');
                        for (int i = 0; i < tempValues.Length; i++)
                        {
                            for (int j = 0; j < cbl.Items.Count; j++) {
                                if (cbl.Items[j].Text.Trim() == tempValues[i].ToString())
                                {
                                    cbl.Items[j].Selected = true;
                                }
                            }
                        }
                    }
                    else {
                        string[] tempValues = values.Split(',');
                        for (int i = 0; i < tempValues.Length; i++)
                        {
                            for (int j = 0; j < cbl.Items.Count; j++)
                            {
                                if (cbl.Items[j].Value.Trim() == tempValues[i].ToString())
                                {
                                    cbl.Items[j].Selected = true;
                                }
                            }
                        }
                    }
                  
                }
                else {

                }
            }

  • 相关阅读:
    可方便扩展的JIRA Rest Web API的封装调用
    小诗一首
    jxse2.6在jdk8下,JxtaMulticastSocket存在的问题
    http://blogs.msdn.com/b/pranavwagh/archive/2007/03/03/word-2007-file-seems-to-be-deleted-when-you-open-and-save-it-using-dsoframer.aspx
    how to javafx hide background header of a tableview?
    Styling FX Buttons with CSS
    2d网络游戏的延迟补偿(Lag compensation with networked 2D games)
    Fast-paced Multiplayer
    jspace2d——A free 2d multiplayer space shooter
    JXSE and Equinox Tutorial, Part 2
  • 原文地址:https://www.cnblogs.com/bestsaler/p/1835700.html
Copyright © 2011-2022 走看看