Answers for "c# datagridview get data from selected row"

C#
1

get selected data from datagridview c#

private void dataGridView_SelectionChanged(object sender, EventArgs e) 
{
    foreach (DataGridViewRow row in dataGridView.SelectedRows) 
    {
        string value1 = row.Cells[0].Value.ToString();
        string value2 = row.Cells[1].Value.ToString();
        //...
    }
}
Posted by: Guest on May-06-2022
0

c# datagridview get selected row values

int rowindex = dataGridView1.CurrentCell.RowIndex;
int columnindex = dataGridView1.CurrentCell.ColumnIndex; 

dataGridView1.Rows[rowindex].Cells[columnindex].Value.ToString();
Posted by: Guest on August-28-2021
0

c# datagridview selected row index

datagridview.CurrentCell.RowIndex
Posted by: Guest on November-21-2020

Code answers related to "c# datagridview get data from selected row"

C# Answers by Framework

Browse Popular Code Answers by Language