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 閱讀(307) 評論(0)  編輯  收藏

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


          網站導航:
           

          常用鏈接

          留言簿(5)

          隨筆分類

          隨筆檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 紫金县| 肇源县| 荆州市| 郧西县| 克山县| 札达县| 交口县| 上饶市| 德令哈市| 新绛县| 龙游县| 新余市| 兴文县| 随州市| 彭州市| 旬邑县| 双柏县| 衡南县| 宁都县| 肃宁县| 九龙县| 青阳县| 手游| 安新县| 老河口市| 锡林郭勒盟| 苏尼特右旗| 黄龙县| 哈尔滨市| 隆尧县| 上林县| 类乌齐县| 崇仁县| 宁南县| 南京市| 浦东新区| 嵊州市| 桃源县| 河南省| 泸州市| 长武县|