BeforeDelete BO Event


Author
Message
Scott
Scott
StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)
Group: Forum Members
Posts: 176, Visits: 1.5K
I am setting e.Cancel = true; in the BeforeDelete event and I am still being prompted with the message "Are you sure you wish to delete the current record".  It appears that the setting of the cancel property is working becuase it dosen't matter what I answer to the question,  the record is NOT deleted.  I am guessing that the message shouldn't be displayed if the delete was canceled,  right.

Am I doing something incorrectly or not understanding how it works?

StrataFrame Team
S
StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
This actually has to do with the way .NET handles events... your event handler is attached before the event handler in the application framework. Since you cannot specify which event handler is called in which order, it can produce unpredictable results. Your best bet is to disable the AutoDeleteConfirmation property on the form and show a delete confirmation on your own.
Scott
Scott
StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)
Group: Forum Members
Posts: 176, Visits: 1.5K
Will do.  Thanks for the info.

By the way,  I am using the messageform class and in the help file it looks completly different then what is showing up.  On my screen it is a pink window, in the help file it look like a Windows themed window.  Why is that?  Is it a setting on my machine?

Trent Taylor
Trent Taylor
StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
The pink is the transparent color.  It is possible that this could come from your machine if there is some type of video driver ignoring the .NET transparency.  Are you calling the MessageForm directly or through a localization key?  You might give me an example of how you are calling the window and a screen shot.  If you are having an issue I would like to work through it and see if we can reproduce the problem.  Thanks.
Scott
Scott
StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)
Group: Forum Members
Posts: 176, Visits: 1.5K
I am even seeing this behaivor in the sample application.  In my project I am calling MessageForm directly,  here is the code and screen shot:

loItem = new MessageItem();

loItem.Title = "Delete Aborted";

loItem.EventID = "";

loItem.MessageFunctionality = MessageFunction.OK;

loItem.MessageIcon = MessagingIcon.StopSign;

loItem.MessageSound = MessagingSounds.ErrorSound;

 

loItem.Text = "";

if (this.CategoryBO.BrokenRules.Count > 0)

   foreach (BrokenRule loRule in this.CategoryBO.BrokenRules.ToArray())

      loItem.Text += loRule.Description;

else

   loItem.Text = "Delete Aborted";

 

MessageForm.ShowMessage(loItem);

Thanks

Scott

Trent Taylor
Trent Taylor
StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)StrataFrame Developer (9.8K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
I will see if we can prevent this from happening.  THe reason this is occuring on your computer has somthing to do with video drivers.  In .NET, you can set a transparency color and set the .AllowTransparency to True on a form.  This prevents some flicker when instantiating.  I assume you are having the same problem with a WaitWindow and the InfoBox then, is that correct?  To see if you get the same error on an InfoBox, open the sample application, the open the Customers Maintenance form.  Click New, then Save.  You should get an error message at the bottom left of the window.  Let me know if this is pink as well.  I will look at the MessageForm's transparency and see if we can just turn it off.  However, that will be more difficult for a WaitWindow and the InfoBox.  These windows actually use the transparency in depth since there is fading and scrolling involved.  That is why I would like to see if it happens on them as well.  Thanks.
Scott
Scott
StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)
Group: Forum Members
Posts: 176, Visits: 1.5K
Here is a shot of the infobox.


Scott
Scott
StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)
Group: Forum Members
Posts: 176, Visits: 1.5K
And here is the video info:


Scott
Scott
StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)StrataFrame User (176 reputation)
Group: Forum Members
Posts: 176, Visits: 1.5K
Here is something else that might be related to the transparency issue.  This is the Database connection configuration form all I see are the controls, no "form" they just kind of float there in space.


StrataFrame Team
S
StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)StrataFrame Developer (4.1K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Thanks for the screen shots, Scott, we're in the process of figuring this one out Smile
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search