• Gridviewcontrol控件和DataGridView控件获得当前选中行


    Gridviewcontrol控件在事件处理函数中取得当前行的某列的值:

    string buyPlanId = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "BuyPlanId").ToString();

    int buyState = Convert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "BuyState"));

    控件的DoubleClick属性

      private void gridControl1_DoubleClick(object sender, EventArgs e)
            {
                if (gridView1.FocusedRowHandle < 0)//判断是否有选中行
                {
                    return;
                }
                string InAndOutMainId = gridView1.GetDataRow(gridView1.FocusedRowHandle)["InAndOutMainId"].ToString();
                量产发货单详情 lcfhd = new 量产发货单详情(InAndOutMainId);
                lcfhd.ShowDialog();
            }

    加双击某行事件:

    双击CellContentDoubleClick 属性

    DataGridView控件在事件处理函数中取得当前行的某列的值: 

    int currentRowIndex = dataGridView1.CurrentRow.Index;
    string WorkItemname = dataGridView1.Rows[currentRowIndex].Cells["CodeBak1"].Value.ToString();
    dataGridView2.DataSource = dyh.WorkItemInfoDetail(WorkItemname);
  • 相关阅读:
    51nod 1081 子段求和
    51nod 1085 背包问题
    51nod 1012 最小公倍数LCM
    51nod 1046 A^B Mod C
    51nod 1057 N的阶乘
    死锁 必然
    two-sum
    一些基本定义
    常用命令
    python_99_面向对象多态
  • 原文地址:https://www.cnblogs.com/sulong/p/4707597.html
Copyright © 2020-2023  润新知