記錄DEV gridview獲取行列數據方法


DataRow dr = this.gridView1.GetDataRow(this.gridView1.FocusedRowHandle);//獲取選中行
            string str = gridView1.GetFocusedRowCellValue("PEBID").ToString();//獲取某一行的指定列的值

  獲取每行指定列的數據(可處理批量選擇)

List<int> selectRows;
            List<int> custcode = new List<int>();
            selectRows = this.gridView1.GetSelectedRows().ToList();
            foreach (int i in selectRows)
            {
                custcode.Add(int.Parse(this.gridView1.GetDataRow(i)["PEBID"].ToString()));
            }

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM