KES

Archive for the ‘Windows Forms’ Category

This is not rocket science, but it is useful for those of us who are simplicity challenged.

q: how do you select a DataGridViewRow when the cell is clicked on.

a: using the cell click (or similar depending on your needs) add this general method

private

void dvg_CellClick(object sender, DataGridViewCellEventArgs e)

{

if

(e.RowIndex > -1)

{

var dgv = (DataGridView) sender;dgv.Rows[e.RowIndex].Selected =

true;

}

}