473,395 Members | 1,473 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Datagrid and datasource sync. problem

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

Nov 20 '05 #1
3 1756
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

AH wrote:
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
Nov 20 '05 #2
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
-----Original Message-----
Trap the KeyPress event and look for the down arrow key. Compare theCurrentRowIndex with the DataTable, if it exceeds it. Then save the data tothe DataTable.

This sounds awfully familiar

Regards - OHM

AH wrote:
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
.

Nov 20 '05 #3
Not that I know of, but this does not mean that it is not possible.

Regards - OHM

an*******@discussions.microsoft.com wrote:
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
-----Original Message-----
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

AH wrote:
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
.


Regards - OHM# OneHandedMan{at}BTInternet{dot}com
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Pierluigi Terzoli | last post by:
Hi everybody, I need help for this problem: I'm using a DataGrid to Insert/Modify/Cancel data from a single table. At the moment, every cell modification of a pre-existing row is correctly update...
0
by: berullus | last post by:
I created a datagrid in windows form and the datasource for it is a datatable. It works fine when I add a new row in the grid and click on Save button which I added on the form to save as xml file....
7
by: TT (Tom Tempelaere) | last post by:
Hi there, I'm struggling to get the right event. I want to be notified of a change in a cell in a DataGrid made by a user. I need following information about the change: * the row index * the...
1
by: Rick | last post by:
Hello all, I hope all is well with you. I am having a seriously difficult time with this problem. Allow me to set up the problem. I have a System.Web.UI.Page with the following controls...
2
by: Tomek R. | last post by:
Hello ! I've got weird problem when adding new datagrid item. Here is the situation: my grid dgDeps is binded to DepartmentList arraylist, stored in Session between round-trips.. To add new...
1
by: Joe Reggae | last post by:
Hello, I'm a little weak in understanding concepts surrounding currency and binding context and appreciate advice in getting some grids to bind (in sync) to three related tables. ...
2
by: Gene Hubert | last post by:
I'm assigning a new datasource (a datatable) to a datagrid that is aready displayed in a form. Then I assign a new value to CurrentRowIndex. The datagrid always scrolls so that the new current...
5
by: HS1 | last post by:
Hello I have a DataGrid and using some TextBox(es) to present data of this DataGrid. I can show the data by setting fields for these TextBox (in design view). However, I want to write codes (event...
3
by: Brian Tkatch | last post by:
I have a form with two DataGrids, which are kept in sync manually via Stored PROCEDURE calls. That is, when a record is selected on the first grid, a stored PROCEDURE is CALLed to Fill() the next...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.