当我点击聚焦行时如何将聚焦行列值导入EditText? Winforms Devexpress

时间:2013-11-06 08:07:27

标签: c# gridview devexpress

我有Gridview,其中有6行。现在,当我单击对应行中的任何单元格时,我想获得聚焦行列值。例如,我想获得Student Exam_no,如果我点击学生姓名,地址或部门,我希望获得Exam_no的同一行中的任何单元格。如何完成我的任务?

  private void gridControl2_Click(object sender, EventArgs e)
    {
        var frm = new New_Invoice();
        frm.Show();
        gridView1.RefreshData();
    }

这个代码我试过但不能正常工作吗? 在此先感谢。

1 个答案:

答案 0 :(得分:0)

Private Sub GridView1_RowCellClick(ByVal sender As Object, ByVal e As DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs) Handles GridView1.RowCellClick

    Dim myColumn As String = e.Column.FieldName ' for the datasource column name
           Dim myValue = GridView1.GetFocusedDataRow(myColumn)

    'For a standard one column
    myValue = view.GetFocusedDataRow("ColumnX")

End Sub