I have a default data entry screen in Lightswitch. Problem is, when the user does not wish to enter a new record, the user closes the screen to navigate elsewhere. Upon closing the form, the user is presented with the "Save changes before closing?" message. Is there a way I can suppress this message in a scenario in which the user has not entered any data in this screen?
Asked
Active
Viewed 2,853 times
1 Answers
3
In the screen's Closing method, you can add a call to DiscardChanges for the entity that the screen is bound to (which I've called EntityPropertyName in the code below).
VB:
Me.EntityPropertyName.Details.DiscardChanges
C#:
this.EntityPropertyName.Details.DiscardChanges();

Yann Duran
- 3,842
- 1
- 24
- 24
-
Thanks Yann. This put me on the right track to find that the line is actually "this.EntityPropertyName.Details.DiscardChanges();" – Shawn de Wet Aug 31 '12 at 02:07
-
Oh, so it is, sorry about that. – Yann Duran Aug 31 '12 at 09:57