save record in datagrid while still editing

  • Thread starter Thread starter jaYPee
  • Start date Start date
J

jaYPee

i'm wondering how can i update the current record in datagrid while
still editing the record. cause i have a checkbox in my datagrid and i
want to save the record before changing the value of this checkbox to
true to enforce referential integrity. i don't have problem changing
the checkbox to true if the record/row in my datagrid is already save.
the problem is that if it is the 1st time i add record to this
datagrid and then update the checkbox to true.

thanks in advance for any help.
 
Hi jaYPee,

You can look what currentcellchanged event from the datagrid (and than check
in that the columnumber if it is the checkbox) and than the
currencymanager.endcurrentedit can do for you.

Not tested just an idea?

Cor
 
thanks for the immediate reply. here's my code i used. it is working
the 2nd time i click the checkbox again. but didn't work the 1st time
i click the checkbox

DataGrid1.EndEdit(Nothing, DataGrid1.CurrentRowIndex, False)
DataGrid1.BindingContext(DataGrid1.DataSource,
DataGrid1.DataMember).EndCurrentEdit()

'save record first before adding course

SqlDataAdapter2.Update(DsStudentCourse1)
 
Back
Top