标签:
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);
Gridviewcontrol控件和DataGridView控件获得当前选中行
标签:
原文地址:http://www.cnblogs.com/sulong/p/4707597.html