Datagridview full row selection but get single cell value

后端 未结 16 1153
傲寒
傲寒 2020-12-02 12:12

I have a datagridview that is a full row select. How would I grab the data from only a certain cell no matter what cell in the row was clicked on since it highlights the ent

16条回答
  •  渐次进展
    2020-12-02 12:51

    this get me the text value of exact cell in data grid view

    private void dataGridView_SelectionChanged(object sender, EventArgs e)
        {
            label1.Text = dataGridView.CurrentRow.Cells[#].Value.ToString();
        }
    

    you can see it in label and change # wih the index of the exact cell you want

提交回复
热议问题