this.GridView1.Rows[?????].Cells[0].Text; ????出應(yīng)該是什么?謝謝問題補充: String a = this.GridView1.Rows[GridView1.SelectedIndex].Cells[0].Text; this.Label1.Text = a; 無法編譯通過啊 我說的值不是所在列的行數(shù),是查詢結(jié)果中的值 我說個例子吧 table id ,name ,age 1 aa 23 2 bb 21 做個gridview ,把控件的選擇、排序選好,在放個DetailsView 控件 數(shù)據(jù)源 為 select * from table order by id 用 protected void Page_Load(object sender, EventArgs e) { this.DetailsView1.PageIndex = this.GridView1.SelectedIndex; } 使2個控件聯(lián)動,但是如果在gridview上用age排序后,GridView1的選擇和DetailsView1的不一樣了,因為順序重排了 現(xiàn)在我想問GridView1重新排序后怎么使DetailsView1不出錯 ,還有我點 2 bb 21 這行數(shù)據(jù)前的選擇按鈕時,怎么得到 name列的值(重新排序后使結(jié)果仍然正確) 給2張圖 http://images.cnblogs.com/cnblogs_com/bo8888/79069/r_001.jpg http://images.cnblogs.com/cnblogs_com/bo8888/79069/r_002.jpg 第1張為原始的 002為按其它列排序后的結(jié)果
- 2 回答
- 0 關(guān)注
- 529 瀏覽
添加回答
舉報
0/150
提交
取消