-1

我有 Gridview 和 6 行。现在,当我单击相应行中的任何单元格时,我想获得重点行列值。例如,我想获取学生 Exam_no,如果我单击同一行中的学生姓名、地址或部门的任何单元格,我想获取 Exam_no。如何完成我的任务?

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

这段代码我试过了,但除了我之外什么都没有?提前致谢。

4

1 回答 1

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
于 2013-11-12T13:19:18.017 回答