How to get column value of grid in C# Windows application?

前端 未结 4 1521
庸人自扰
庸人自扰 2021-02-11 01:36

How to get column value of grid in C# Windows application?

When I clicked on the cell, at that time it should get column values.

private void gridAgentD         


        
4条回答
  •  执笔经年
    2021-02-11 02:05

    Use DataGridView.CurrentCell.Value:

    String result = this.gridviewAgentDetails.CurrentCell.Value.ToString();
    

    DataGridView.CurrentCell Property gets the currently active cell.

    DataGridViewCell.Value Property gets the value associated with this cell.

提交回复
热议问题