Change value cell after click on row in DataGridView

  • Thread starter Thread starter PawelR
  • Start date Start date
P

PawelR

Hi Group,
In my application I have DataTable which is displayed in DataGridView via
DataView:

DataView myView = new DataView(myTable);
myDataGridView.DataSource = myView;

One column im myTable is boolean (two state - without null value). How can I
change value in this column after click on row in datagridview (one of cells
in rows).
Before sorting this is no problem, but after sort data by user (click in
header of column) row index in datagridview and row index in dataview (and
table) are diferent.

Thx for help

Pawel
 
From memory( a very shaky source :0)
the DataGridView CurrentRow property can be indexed into to get to a
particular cell.
Something like
DataGridViewRow r = this.dgv1.CurrentRow;
r[2] = true;
hth
Bob
 
Back
Top