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()));
            }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-16
  • 2021-10-21
  • 2021-10-08
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-12
  • 2022-12-23
  • 2022-12-23
  • 2022-01-14
相关资源
相似解决方案