Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm Data Binding / November 2005

Tip: Looking for answers? Try searching our database.

Using CurrencyManager's ItemChanged Event correctly

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
michael - 28 Nov 2005 02:47 GMT
I assumed that the CurrencyManager's ItemChanged event could be used to
identify that some part of a row has changed and allow for the opportunity to
ask the user if they want to keep the change (or not) prior to changing the
CurrencyManager's position.

I have found the that ItemChanged event is raised if the data in the current
position is changed and then the position is changed. When the ItemChanged
event is fired, I can ask the user if they want to commit the changed or
rollback. However, I find that if I do rollback (or reject the changes)
another ItemChanged event is fired right on top of the last one, causing the
same prompt "keep changes..." to be shown again.

I tried using Suspen/Resume binding while reinstating the original data, but
seem to have other errors occur instead.

What's the correct way to use the ItemChanged event so that it doesn't get
re-fired after a rollback or reject changes?

Michael
Signature

Michael Hockstein

"Jeffrey Tan[MSFT]" - 28 Nov 2005 08:16 GMT
Hi Michael,

Thanks for your post.

Databinding has limited validtion support in .Net1.1. We usually do the
validating in UI side. For example, when doing databinding with DataGrid,
we can use DataGrid.CurrentCellChanged event to do the cell by cell
validating, for more information, please refer to the link below:
"5.20 How can I do cell by cell validation in a datagrid"
http://www.syncfusion.com/faq/windowsforms/search/773.aspx

In .Net2.0, we can use DataGridView's build-in CellValidating event to do
this, please refer to "Validating input" section in the link below:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvsdev05/h
tml/vs05a9.asp

Hope this helps

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.