How to get the selected row values of DevExpress XtraGrid?

前端 未结 7 789
后悔当初
后悔当初 2020-12-03 07:48

Consider the following picture

\"enter

I get the selected row values in the th

7条回答
  •  没有蜡笔的小新
    2020-12-03 08:17

    All you have to do is use the GetFocusedRowCellValue method of the gridView control and put it into the RowClick event.

    For example:

    private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
    {
        if (this.gvCodigoNombres.GetFocusedRowCellValue("EMP_dni") == null)
            return;
        MessageBox.Show(""+this.gvCodigoNombres.GetFocusedRowCellValue("EMP_dni").ToString());            
    }
    

提交回复
热议问题