How do I properly detect row change before allowing moving to next row?
I tried using RowLeave .
here is brief descript of the form setup.
I have
ieStringTmpData Setwith regex table connected to a SQL mdf.,
on the form I have a regexDataGridVi ew for the table regex for
navigation and viewing purpose only
also the associated navigator, detail view controls bounded with the
same binding source for editing.
so the current row of the regexDataGridVi ew is shown on the detail view
controls
here is the code for the Rowleave Event
DataRow[] dr = ieStringTmpData Set.Regex.Selec t("", "",
DataViewRowStat e.ModifiedCurre nt);
int irowsChgd = dr.GetUpperBoun d(0) + 1;
if (regexDataGridV iew.IsCurrentRo wDirty | irowsChgd 0)
{
DialogResult dlgReslt = MessageBox.Show ("Save Changes?",
this.Text + " - The row has unsaved changes",
MessageBoxButto ns.YesNo);
if (dlgReslt == DialogResult.Ye s)
{
regexBindingNav igatorSaveItem. PerformClick();
setStatus("Save d change to regex " +
regexNameTextBo x.Text);
}
else
{ //' problem with cancelling change, cancel edit does not
work
regexDataGridVi ew.CancelEdit() ;
ieStringTmpData Set.RejectChang es();
// causes exception later:
ieStringTmpData Set.Regex.Reset ();
setStatus("Chan ge to regex is still pending for " +
irowsChgd + " rows. Please reload to forget change");
}
}
else if (statusLabel.Te xt != "Ready") setStatus("Read y");
Problem: the event tend to delay prompting until 2nd row leave after a row
has been modified
your help to show me the propeway to detect modifcation is much appreciated.
thank you for your time and advice
Btw regexDataGridVi ew.IsCurrentRow Dirty always returns false 2 4183
On Dec 31, 9:58*am, "GS" <gsmsnews.micro soft.co...@msne ws.Nomail.com>
wrote:
How do I properly detect row change before allowing moving to next row?
I tried using RowLeave .
here is brief descript of the form setup.
*I have
* * ieStringTmpData Setwith regex table connected to a SQL mdf.,
* * on the form I have a regexDataGridVi ew for the table regex for
navigation and viewing purpose only
* * * * also the associated navigator, detail view controls bounded with the
same binding source for editing.
so the current row of the regexDataGridVi ew is shown on the detail view
controls
here is the code for the Rowleave Event
* * DataRow[] dr = ieStringTmpData Set.Regex.Selec t("", "",
* * * * *DataViewRowSta te.ModifiedCurr ent);
* * * * * * int irowsChgd = dr.GetUpperBoun d(0) + 1;
* * * * * * if (regexDataGridV iew.IsCurrentRo wDirty | irowsChgd 0)
* * * * * * {
* * * * * * * * DialogResult dlgReslt = MessageBox.Show ("Save Changes?",
* * * * * * * * * * this.Text + " - The row has unsaved changes",
MessageBoxButto ns.YesNo);
* * * * * * * * if (dlgReslt == DialogResult.Ye s)
* * * * * * * * {
* * * * * * * * * * regexBindingNav igatorSaveItem. PerformClick();
* * * * * * * * * * setStatus("Save d change to regex "+
regexNameTextBo x.Text);
* * * * * * * * }
* * * * * * * * else
* * * * * * * * { * //' problem with cancelling change, cancel edit does not
work
* * * * * * * * * * regexDataGridVi ew.CancelEdit() ;
* * * * * * * * * * ieStringTmpData Set.RejectChang es();
* * * * * * * * * * // causes exception later:
ieStringTmpData Set.Regex.Reset ();
* * * * * * * * * * setStatus("Chan ge to regex is still pending for " +
irowsChgd + " rows. Please reload to forget change");
* * * * * * * * }
* * * * * * }
* * * * * * else if (statusLabel.Te xt != "Ready") setStatus("Read y");
Problem: the event tend to delay prompting until 2nd row leave *after a row
has been modified
your help to show me the propeway to detect modifcation is much appreciated.
thank you for your time and advice
Btw regexDataGridVi ew.IsCurrentRow Dirty always returns false
Try using the RowValidating event. Inside the
DataGridViewCel lCancelEventArg s is the Cancel property for this Row.
Greg
uh...., the event seems to be called regardless if the are changes. just
change to a different row, will trigger it to fire until one replies yes
unless I put in a test query for dirty row
then I will face the same problem of missing the prompt on first row change
after a row is modified
"Greg" <gc*****@gmail. comwrote in message
news:8c******** *************** ***********@i12 g2000prf.google groups.com...
On Dec 31, 9:58 am, "GS" <gsmsnews.micro soft.co...@msne ws.Nomail.com>
wrote:
How do I properly detect row change before allowing moving to next row?
I tried using RowLeave .
here is brief descript of the form setup.
I have
ieStringTmpData Setwith regex table connected to a SQL mdf.,
on the form I have a regexDataGridVi ew for the table regex for
navigation and viewing purpose only
also the associated navigator, detail view controls bounded with the
same binding source for editing.
so the current row of the regexDataGridVi ew is shown on the detail view
controls
here is the code for the Rowleave Event
DataRow[] dr = ieStringTmpData Set.Regex.Selec t("", "",
DataViewRowStat e.ModifiedCurre nt);
int irowsChgd = dr.GetUpperBoun d(0) + 1;
if (regexDataGridV iew.IsCurrentRo wDirty | irowsChgd 0)
{
DialogResult dlgReslt = MessageBox.Show ("Save Changes?",
this.Text + " - The row has unsaved changes",
MessageBoxButto ns.YesNo);
if (dlgReslt == DialogResult.Ye s)
{
regexBindingNav igatorSaveItem. PerformClick();
setStatus("Save d change to regex " +
regexNameTextBo x.Text);
}
else
{ //' problem with cancelling change, cancel edit does not
work
regexDataGridVi ew.CancelEdit() ;
ieStringTmpData Set.RejectChang es();
// causes exception later:
ieStringTmpData Set.Regex.Reset ();
setStatus("Chan ge to regex is still pending for " +
irowsChgd + " rows. Please reload to forget change");
}
}
else if (statusLabel.Te xt != "Ready") setStatus("Read y");
Problem: the event tend to delay prompting until 2nd row leave after a row
has been modified
your help to show me the propeway to detect modifcation is much
appreciated.
thank you for your time and advice
Btw regexDataGridVi ew.IsCurrentRow Dirty always returns false
Try using the RowValidating event. Inside the
DataGridViewCel lCancelEventArg s is the Cancel property for this Row.
Greg This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: selowan |
last post by:
Hi,
In VB6 Pro SP5, I have a form that contains an MSFlexGrid and a few
other textboxes and comboboxes. I am using the technique from MSDN
article Q241355, which describes how to tab and edit in a flexgrid.
Briefly, the technique is to overlay the cell to be edited with
"floating" textbox; data is edited in the floating textbox and moved
to the cell when the floating textbox loses focus.
The technique works well except for when the...
|
by: MightyMo |
last post by:
Is it possible to detect the user's next location?
I need to be able to detect if a user is abandoning the site.
window.location and window.location.href triggered by onUnload can
only tell me the current location, and I can't tell where the next
location is.
If you know of a way to do this, please let me know!
|
by: Agoston Bejo |
last post by:
Hi,
I searched around everywhere on the net, but could not find a simple example
of detecting if cookies are enabled - on server side, and without moving
from one page to another.
This should be a very basic functionality, so I am reluctant to believe that
there's no way to simply test it in a server-side script.
Anyone?
Thx,
Agoston
|
by: RC |
last post by:
I have an Access 2002 database with many tables and forms (but just to
keep things simple, let's say the DB has one Table "Table1" and one
Form "Form1").
I have managed to cobble together so much complex code to add records
and edit records I need to step back and ask you all what is the
proper way to do this. The database is DAO. The table has Columns
SerialNumber, CPU, HardDrive and Model. I am trying to use a Form to
fill out the...
|
by: Roy |
last post by:
Hi,
I have a problem that I have been working with for a while.
I need to be able from server side (asp.net) to detect that the file i'm
streaming down to the client is saved completely/succsessfully on the
client's computer before updating some metadata on the server (file
downloaded date for instance)
However,
All examples i have tried, and all examples I have found that other people
says works - doesn't work for me :-(
| |
by: Ludovic Lemarinel |
last post by:
Hi,
I've got a Tab Control, with a lot of tabs, and a lot of controls in each
tab (textboxes, comboboxes, listviews, checkboces, etc...). As these
controls are updating a Database, I need to detect if there is any change on
any control when closing then form, or on record change .
I know which events I should use, but I can't see any property to find if my
controls have changes.
|
by: Gabe Covert |
last post by:
If I instantiate an XmlDocument object, the load a file through the Load
method, is there a way, later on in execution, to easily determine if the
XmlDocument object has changed from the original version loaded?
I'd like to be able to check a condition to see if the document in memory
has been editted (i.e., nodes added, attributes changed, etc.) so that my
user can decide whether or not to commit changes to the disk file before
moving...
|
by: alexandre.brisebois |
last post by:
Hi, I am using access 2003, I would like to know if there is an option
to reorganize the tables in a maner that is readable, as we can do in
sql sever 2000 or 2005.
I have been given a database to look a and I am loosing tremendious
amounts of time trying to organize it so that I could view it.
Regards,
Alexandre Brisebois
|
by: mattmao |
last post by:
Hi all.
There is a challenge question I encountered recently, which says:
"In plain English, there are six different ways when you want to tell someone else about the current time:
It is five past seven.
It is eleven to ten.
It is half past nine.
It is a quarter past eight.
It is a quarter to ten.
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |