save record in datagrid while still editing

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.
 
C

Cor Ligthert

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
 
J

jaYPee

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top