我们在想数据库中添加记录后往往会希望将GridView跳转到新添行,

在DeveExpress中可以这样实现

            //根据单位名称定位当前行
            string searchtxt = "字符串";
            GridColumn column = dataGridView1.Columns["订货单位名称"];
            int rhFound = dataGridView1.LocateByDisplayText(dataGridView1.FocusedRowHandle + 1, column, searchtxt);
            dataGridView1.FocusedRowHandle = rhFound;

在dataGridView中可以这样实现

           //获取行值
           dataGridView1.CurrentCell = dataGridView1.Rows[ID].Cells["列名"];

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-18
  • 2022-12-23
  • 2021-09-15
  • 2022-03-02
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-03-31
  • 2022-12-23
  • 2022-12-23
  • 2021-07-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案