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)  編輯  收藏

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


          網站導航:
           

          常用鏈接

          留言簿(5)

          隨筆分類

          隨筆檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 永嘉县| 涿州市| 那坡县| 长治县| 英吉沙县| 梧州市| 呼图壁县| 裕民县| 余姚市| 五大连池市| 昭通市| 麦盖提县| 高密市| 花垣县| 海丰县| 昌都县| 新营市| 朝阳区| 清水县| 景宁| 麻江县| 柘荣县| 宝山区| 尼玛县| 崇明县| 平舆县| 阿拉善盟| 娱乐| 田阳县| 台南市| 辽宁省| 淄博市| 新闻| 周口市| 辽阳市| 扶余县| 富阳市| 普陀区| 宝清县| 古田县| 柳河县|