Hi
I have a datagridview (not bound to data source). I need to change some cells values based on the selection made using contextMenuStripI have two different contextMenuStrips. One for Type and one for Price.
This is an example for one of the types if selected.
//This will change the selected rows/by its cells with the value USA
private void Type_USA() { if (dgv1.SelectedRows.Count > 0) { DataGridViewSelectedRowCollection mc= dgv1.SelectedRows; for (int i = 0; i < mc.Count; i++) { DataGridViewRow row = mc[i]; row.Cells[2].Value = "USA"; } } }Currently, in DGV1_CellValueChanged() I have this:
if (dgv1.Columns[e.ColumnIndex].Name == "Type"){ Type_USA();}