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 {

                      }
                  }

          posted on 2009-04-07 16:20 sanmao 閱讀(305) 評論(0)  編輯  收藏

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           

          常用鏈接

          留言簿(5)

          隨筆分類

          隨筆檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 阳西县| 仲巴县| 长丰县| 平泉县| 井陉县| 新疆| 定边县| 定南县| 海伦市| 陆河县| 日喀则市| 车险| 根河市| 桐乡市| 南川市| 黑龙江省| 宣恩县| 巴东县| 资溪县| 三河市| 商都县| 贡嘎县| 繁峙县| 家居| 新营市| 海原县| 临沭县| 庄河市| 汶川县| 东宁县| 遂宁市| 邵阳市| 巴楚县| 邵武市| 图片| 黄浦区| 耿马| 舒兰市| 凤阳县| 汉寿县| 信宜市|