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)

          隨筆分類

          隨筆檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 六安市| 扎兰屯市| 潍坊市| 长沙市| 凭祥市| 乌鲁木齐县| 松江区| 崇阳县| 新营市| 望江县| 东乌珠穆沁旗| 邢台县| 顺义区| 新丰县| 墨玉县| 佛坪县| 饶阳县| 锡林郭勒盟| 商南县| 陈巴尔虎旗| 余庆县| 特克斯县| 凌云县| 台东县| 旬阳县| 安岳县| 东源县| 铜山县| 牡丹江市| 双桥区| 浮梁县| 林口县| 莱芜市| 青河县| 亚东县| 利辛县| 石首市| 巩留县| 石景山区| 梧州市| 平昌县|