473,387 Members | 1,516 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,387 software developers and data experts.

window form detail view auto save

GS
I Google search for answer to detected changes to the current row in detail
view of a windows form ( not datagridview), so far I have not got the right
search term to get me the answer, certainly I found lots on datagridview and
..net asp form.

Is there an easy way to detect if the current record has been changed during
row leave or somehow let me prompt user to save change or cancel edit
Dec 30 '07 #1
5 2407
gs
got the save partially solved. on the event rowLeave
DataRow[] dr = ieStringTmpDataSet.Regex.Select("", "",
DataViewRowState.ModifiedCurrent);
if (regexDataGridView.IsCurrentRowDirty | dr.GetUpperBound(0) >= 0){
DialogResult dlgReslt = MessageBox.Show("Save Changes?",

this.Text + " - The row has unsaved changes",
MessageBoxButtons.YesNo);

if (dlgReslt == DialogResult.Yes){

regexBindingNavigatorSaveItem.PerformClick();

setStatus("Saved change to regex " + regexNameTextBox.Text);

}else

{ //' problem with cancelling change, cancel edit does not
work

// on next row leave wihtout additonal change, I still
get prompted

// help here to cacnel the change

}

}
"GS" <gs**********************@msnews.Nomail.comwrote in message
news:eI**************@TK2MSFTNGP02.phx.gbl...
>I Google search for answer to detected changes to the current row in detail
view of a windows form ( not datagridview), so far I have not got the
right
search term to get me the answer, certainly I found lots on datagridview
and
.net asp form.

Is there an easy way to detect if the current record has been changed
during
row leave or somehow let me prompt user to save change or cancel edit


Dec 30 '07 #2
Hmm, try saving info (entering) and before exiting check as suggested,
and restore info if user want to cancel?
just thinking out loud...
//CY
Dec 30 '07 #3
I suppose I can save the record info during entering the record and restore
on user request not to save.

However,
1. that will add unnecessary database traffic
2. is there not a proper way to cancel edit? I have used other ide and
tools and there is definite mechanism to cancel change

<ch*******@gmail.comwrote in message
news:ee**********************************@i12g2000 prf.googlegroups.com...
Hmm, try saving info (entering) and before exiting check as suggested,
and restore info if user want to cancel?
just thinking out loud...
//CY

Dec 31 '07 #4
GS
there is something called DataRowVersion.Original or DataRowVersion.Proposed
In other word Microsoft has already designed in something for retrieving
original vs. proposed value for a databound control. that makes sense.

the problem here is finding the proper way to cancel forget proposed values
for a given row the way Microsoft designed so I don't run afoul of exception
later on.

Furthermore the method for me to detect row change is not reliable in that
tends to ignore the change on the first row leave after the change.

<ch*******@gmail.comwrote in message
news:ee**********************************@i12g2000 prf.googlegroups.com...
Hmm, try saving info (entering) and before exiting check as suggested,
and restore info if user want to cancel?
just thinking out loud...
//CY

Dec 31 '07 #5
GS
I finally after hours of Google and found the datset rejectchanges work
Something like
ieStringTmpDataSet.RejectChanges();
Still have problem with proper detect of row change though and appreciate
help.

"GS" <gs**********************@msnews.Nomail.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
there is something called DataRowVersion.Original or
DataRowVersion.Proposed
In other word Microsoft has already designed in something for retrieving
original vs. proposed value for a databound control. that makes sense.

the problem here is finding the proper way to cancel forget proposed
values
for a given row the way Microsoft designed so I don't run afoul of
exception
later on.

Furthermore the method for me to detect row change is not reliable in that
tends to ignore the change on the first row leave after the change.

<ch*******@gmail.comwrote in message
news:ee**********************************@i12g2000 prf.googlegroups.com...
Hmm, try saving info (entering) and before exiting check as suggested,
and restore info if user want to cancel?
just thinking out loud...
//CY


Dec 31 '07 #6

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

Similar topics

6
by: DJ Majestik | last post by:
OK, I am devising a php page that will handle a form submission, and wanted to know if anyone has already setup such an idea, or if you had links to point to good tutorials on this. Basically I...
2
by: cillic | last post by:
I have a page which consists of index.html, navigation.html and home.html. Index.html has the following frameset info... <FRAMESET COLS="250,*" FRAMEBORDER="NO" FRAMESPACING="0"...
4
by: deko | last post by:
I'm trying to set up a "preferences form" where users can choose from a few different pre-defined colors. The color numbers and form names are saved in tblColors. The below code changes the form...
5
by: Kevin Myers | last post by:
How can one obtain obtain the height of a MS Access 2K form? There is a width property, but I don't see a corresponding height property. I need to obtain the height of the form so that I can...
17
by: Barret Bonden | last post by:
As an old programmer just now looking at VB.net I have a question: How does one simply open one form from another ? I don't mean how does one create a new instance of that form , but rather how...
11
by: Chippy | last post by:
This is driving me NUTZ. All of my forms are keeping the size of the window I design them in, even when I have the AutoResize option set to Yes. The actual form (grey, gridded area) is the size...
26
by: yb | last post by:
Hi, Is there a standard for the global 'window' object in browsers? For example, it supports methods such as setInterval and clearInterval, and several others. I know that w3c standardized...
7
by: John Fox | last post by:
Dear All, How do I set the size of the window that is showing the database forms? can't find any helps on it. John Fox
5
by: kenethlevine | last post by:
Hello I am fairly new to Access and am having a problem for which I am trying everything without success. It is access 2003. I have a main form. When the user presses a button a modal popup...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.