Home  |  Index  |  Dotnet4all Snippets  |  Submit resources
About  |  Mail us  
Dotnet4all Logo
Datagrid loses user entries (Saturday, September 18, 2004)
 

Found the following interesting discussion in the Newsgroups:

datagrid loses user entries
by:Sean Foley


I have a MDI parent (basically a menu) and a MDI child (data form with
datagrid). When i close the parent and the datagrid has been changed i ask
the user if they wish to save changes made in the grid

The save routine that i have on the MDI child accessed via a button on the
form saves all data entered including the active cell which is that active
control a datagridtextbox

when i call my save routine in the child form from the parent form, i lose
the data entered if the user did not move off of the edited row of a
datagrid?

I have tried many things and think that it is not activating the lostfocus
event of the row, grid or whatever.

Don't know what else to try.


 Reply:
by:Sean Foley

 Basically the currency manager itemschanged event is not kicking off. I used
the currency manager to kickoff the positionchanged event.

Need to accomplish clicking to a different datagrid row programmatically?
which kicks off both positionchanged and itemchanged events.

ANY HELP GREATLY APPRECIATED


 Reply:
by:Sean Foley

 okay, solution found :)

Dim myBindingManager As BindingManagerBase = BindingContext(myDataSet,
"mydatatable")

myBindingManager.SuspendBinding()

myBindingManager.ResumeBinding()

Only problem now, is if the user does not move off the current cell that one
entry is lost. At least the row on an insert or on an update with cells is
not lost than where the cursor is, is not lost.



Posted by Xander Zelders



 
Previous Posts
    - GridColumnStyle that has a Width that 'Expands' to...
    - How to split a vb.net application
    - How to open a notepad file for viewing in ReadOnly...
    - Pages User Permissions
    - How does one control the what is entered in a boun...
    - UNC System.IO
    - ClassName case sensitive
    - Tokenizer question
    - Adding buttons programmatically in visual basic .n...
    - convert function to IntPtr

Archives
    - 08/01/2004 - 08/08/2004
    - 08/08/2004 - 08/15/2004
    - 08/15/2004 - 08/22/2004
    - 08/22/2004 - 08/29/2004
    - 08/29/2004 - 09/05/2004
    - 09/05/2004 - 09/12/2004
    - 09/12/2004 - 09/19/2004
    - 09/19/2004 - 09/26/2004
    - 09/26/2004 - 10/03/2004
    - 10/03/2004 - 10/10/2004
    - 01/02/2005 - 01/09/2005
    - 01/09/2005 - 01/16/2005
    - 01/30/2005 - 02/06/2005
    - 01/01/2006 - 01/08/2006


Disclaimer & Terms of Use  | DotNet4All.Com concept & © 2004 - 2007 by  Zelders²  - Holland