1. <ul id="0c1fb"></ul>

      <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
      <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区

      RELATEED CONSULTING
      相關(guān)咨詢
      選擇下列產(chǎn)品馬上在線溝通
      服務(wù)時(shí)間:8:30-17:00
      你可能遇到了下面的問題
      關(guān)閉右側(cè)工具欄

      新聞中心

      這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
      asp.net如何實(shí)現(xiàn)Gridview分頁(yè)保存選項(xiàng)-創(chuàng)新互聯(lián)

      小編給大家分享一下asp.net如何實(shí)現(xiàn)Gridview分頁(yè)保存選項(xiàng),相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!

      成都網(wǎng)站建設(shè)哪家好,找創(chuàng)新互聯(lián)公司!專注于網(wǎng)頁(yè)設(shè)計(jì)、網(wǎng)站建設(shè)、微信開發(fā)、成都小程序開發(fā)、集團(tuán)成都定制網(wǎng)站等服務(wù)項(xiàng)目。核心團(tuán)隊(duì)均擁有互聯(lián)網(wǎng)行業(yè)多年經(jīng)驗(yàn),服務(wù)眾多知名企業(yè)客戶;涵蓋的客戶類型包括:成都崗?fù)?/a>等眾多領(lǐng)域,積累了大量豐富的經(jīng)驗(yàn),同時(shí)也獲得了客戶的一致贊賞!

      代碼如下:



      #region //'Revision: 1.00 Created Date: 2013/08/02 Created ID: Una [#1300071]增加多選框
              ///


              /// Session獲取多選框值
              ///

              private void RememberOldValues()
              {
                  ArrayList categoryIDList = new ArrayList();
                  string index = "";
                  foreach (GridViewRow row in gridView.Rows)
                  {
                      index = (string)gridView.DataKeys[row.RowIndex].Value;
                      bool result = ((CheckBox)row.FindControl("DeleteThis")).Checked;

                      // Check in the Session
                      if (Session["id"] != null)
                          categoryIDList = (ArrayList)Session["id"];
                      if (result)
                      {
                          if (!categoryIDList.Contains(index))
                              categoryIDList.Add(index);
                      }
                      else
                          categoryIDList.Remove(index);
                  }
                  if (categoryIDList != null && categoryIDList.Count > 0)
                      Session["id"] = categoryIDList;
              }

              ///


              /// Session分頁(yè)時(shí)之前多選框?yàn)閠rue
              ///

              private void RePopulateValues()
              {
                  ArrayList categoryIDList = (ArrayList)Session["id"];
                  if (categoryIDList != null && categoryIDList.Count > 0)
                  {
                      foreach (GridViewRow row in gridView.Rows)
                      {
                          string index = (string)gridView.DataKeys[row.RowIndex].Value;
                          if (categoryIDList.Contains(index))
                          {
                              CheckBox myCheckBox = (CheckBox)row.FindControl("DeleteThis");
                              myCheckBox.Checked = true;
                          }
                      }
                  }
              }
              #endregion



      復(fù)制代碼 代碼如下:


      protected void gridView_PageIndexChanging(object sender, GridViewPageEventArgs e)
              {
                  RememberOldValues();
                  gridView.PageIndex = e.NewPageIndex;
                  BindData();
                  RePopulateValues();
              }


      復(fù)制代碼 代碼如下:


      protected void btnSelect_Click(object sender, EventArgs e)
              {
                  string items = "";
                  ArrayList categoryIDList = new ArrayList();
                  string index ="";
                  foreach (GridViewRow row in gridView.Rows)
                  {
                      index = (string)gridView.DataKeys[row.RowIndex].Value;
                      bool result = ((CheckBox)row.FindControl("DeleteThis")).Checked;

                      // Check in the Session
                      if (Session["id"] != null)
                          categoryIDList = (ArrayList)Session["id"];
                      if (result)
                      {
                          if (!categoryIDList.Contains(index))
                              categoryIDList.Add(index);
                      }
                      else
                          categoryIDList.Remove(index);
                  }
                  if (categoryIDList != null && categoryIDList.Count > 0)
                      for (int i = 0; i < categoryIDList.Count; i++)
                      {
                          items += categoryIDList[i] + ",";
                      }
                  items = items.Substring(0, items.Length - 1);
                  ScriptManager.RegisterStartupScript(this, this.GetType(), "", "check('" + items + "');", true);
                  Session.Remove("id");
              }


      以上是“asp.net如何實(shí)現(xiàn)Gridview分頁(yè)保存選項(xiàng)”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對(duì)大家有所幫助,如果還想學(xué)習(xí)更多知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!


      新聞名稱:asp.net如何實(shí)現(xiàn)Gridview分頁(yè)保存選項(xiàng)-創(chuàng)新互聯(lián)
      文章源于:
      http://ef60e0e.cn/article/dgeeje.html
      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区
      1. <ul id="0c1fb"></ul>

        <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
        <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

        博客| 策勒县| 政和县| 慈利县| 南澳县| 西青区| 东乡县| 云阳县| 金塔县| 阿巴嘎旗| 黔西县| 江阴市| 古田县| 若尔盖县| 农安县| 东山县| 北票市| 怀柔区| 丰原市| 普宁市| 会东县| 南昌县| 绥阳县| 阿拉善右旗| 广平县| 揭东县| 武威市| 乐平市| 淮阳县| 建阳市| 蓬溪县| 泽普县| 类乌齐县| 宁远县| 霍城县| 洛隆县| 凤城市| 石楼县| 凌海市| 乐至县| 宜兰市|