[.NET] GridView+SqlDataSource的分頁問題
請輸入專案類型(網站專案或者應用程式專案):VB.net VS2015
各位版友好
我使用DropDownList1、GridView1、GridView2加上SqlDataSource來製作這次的專案
首先,在DropDownList1_SelectedIndexChanged內
SqlDataSource1.SelectCommand = "SELECT ........ GROUP BY .... "
GridView1.DataSourceID = "Sqldatasource1"
接著,在GridView1_SelectedIndexChanged內
SqlDataSource2.SelectCommand = "SELECT ..... order by date"
GridView2.DataSourceID = "Sqldatasource2"
另外,也使用了<asp:CommandField ShowSelectButton="True" />
最後,希望按下GridView1的按鈕後,會顯示GridView2
但是按下第二頁(不管是GridView1或GridView2)時,GridView都會消失,無法顯示內容
雖然有在GridView1_PageIndexChanging和GridView2_PageIndexChanging內
有加上GridView1.PageIndex = e.NewPageIndex
GridView2.PageIndex = e.NewPageIndex
但依舊無效,是否有什麼地方是我沒有注意到的呢?
麻煩了,謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 61.216.21.87
※ 文章網址: https://www.ptt.cc/bbs/Visual_Basic/M.1458637663.A.FB0.html
※ 編輯: renmax (61.216.21.87), 03/22/2016 17:08:02
推
03/22 17:38, , 1F
03/22 17:38, 1F
→
03/22 17:39, , 2F
03/22 17:39, 2F
您好
我有試著將
SqlDataSource2.SelectCommand = "SELECT ..... order by date"
GridView2.DataSourceID = "Sqldatasource2"
放在GridView2_PageIndexChanging內,但依舊無法顯示出第二頁內容
※ 編輯: renmax (61.216.21.87), 03/22/2016 17:43:09
推
03/22 18:44, , 3F
03/22 18:44, 3F
→
03/22 18:44, , 4F
03/22 18:44, 4F
→
03/22 18:44, , 5F
03/22 18:44, 5F
→
03/23 08:46, , 6F
03/23 08:46, 6F
→
03/23 10:25, , 7F
03/23 10:25, 7F
→
03/23 10:36, , 8F
03/23 10:36, 8F
推
03/23 10:40, , 9F
03/23 10:40, 9F
→
03/23 14:17, , 10F
03/23 14:17, 10F
→
03/23 14:17, , 11F
03/23 14:17, 11F
推
03/23 15:45, , 12F
03/23 15:45, 12F
→
03/23 15:45, , 13F
03/23 15:45, 13F
推
03/23 15:49, , 14F
03/23 15:49, 14F
→
03/23 15:50, , 15F
03/23 15:50, 15F
推
03/23 15:52, , 16F
03/23 15:52, 16F
→
03/23 15:53, , 17F
03/23 15:53, 17F
推
03/23 15:58, , 18F
03/23 15:58, 18F
→
03/23 16:51, , 19F
03/23 16:51, 19F
→
03/23 16:57, , 20F
03/23 16:57, 20F
→
03/23 16:58, , 21F
03/23 16:58, 21F
→
03/23 16:59, , 22F
03/23 16:59, 22F
推
03/23 17:23, , 23F
03/23 17:23, 23F
→
03/23 17:23, , 24F
03/23 17:23, 24F
→
03/23 17:24, , 25F
03/23 17:24, 25F
→
03/23 17:25, , 26F
03/23 17:25, 26F
→
03/23 17:26, , 27F
03/23 17:26, 27F
→
03/23 17:27, , 28F
03/23 17:27, 28F
→
03/23 17:27, , 29F
03/23 17:27, 29F
→
03/23 17:27, , 30F
03/23 17:27, 30F
推
03/23 17:30, , 31F
03/23 17:30, 31F
→
03/23 17:30, , 32F
03/23 17:30, 32F
Visual_Basic 近期熱門文章
PTT數位生活區 即時熱門文章