Datagrid and datasource sync. problem

A

AH

Hi, I post this again to hope for valuable help.
I have a window form order entry type of application
where I used a datagrid to capture the order line detail.
the datasource of this datagrid is set to datatable
object. I realised that if I type a new row half way and
focus was shifted to other controls in the form. This
last row is not created in the datatable. However, if I
move my cursor to another row (up or down) and focus was
shifted to other controls, this row is created in the
datatable.
it seems to be that only at the point when I move out of
the row in the datagrid that a record been created in the
datatable, can anyone advise how can I force the
datatable to create the record without first moving into
another row?

Thank you very very much

Albert
 
O

One Handed Man [ OHM# ]

Trap the KeyPress event and look for the down arrow key. Compare the
CurrentRowIndex with the DataTable, if it exceeds it. Then save the data to
the DataTable.

This sounds awfully familiar

Regards - OHM
Hi, I post this again to hope for valuable help.
I have a window form order entry type of application
where I used a datagrid to capture the order line detail.
the datasource of this datagrid is set to datatable
object. I realised that if I type a new row half way and
focus was shifted to other controls in the form. This
last row is not created in the datatable. However, if I
move my cursor to another row (up or down) and focus was
shifted to other controls, this row is created in the
datatable.
it seems to be that only at the point when I move out of
the row in the datagrid that a record been created in the
datatable, can anyone advise how can I force the
datatable to create the record without first moving into
another row?

Thank you very very much

Albert

Regards - OHM# OneHandedMan{at}BTInternet{dot}com
 
G

Guest

hi OHM,thank for the reply, is there a way to trigger
some code so that it can update the datatable
automatically, what happen is on the same form I have a
textbox control to sum the total order value but if I
exit the datagrid without moving into another row, I
can't update the total value since this row is not
recorded in the datatable.
...thank ..it is close to 0330hr on Sunday in this part of
the world....amazing ..

Albert



Thank but I need to
 
O

One Handed Man [ OHM# ]

Not that I know of, but this does not mean that it is not possible.

Regards - OHM

hi OHM,thank for the reply, is there a way to trigger
some code so that it can update the datatable
automatically, what happen is on the same form I have a
textbox control to sum the total order value but if I
exit the datagrid without moving into another row, I
can't update the total value since this row is not
recorded in the datatable.
..thank ..it is close to 0330hr on Sunday in this part of
the world....amazing ..

Albert



Thank but I need to

Regards - OHM# OneHandedMan{at}BTInternet{dot}com
 

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