记录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