StrataFrame Forum

BeforeDelete BO Event

http://forum.strataframe.net/Topic136.aspx

By Scott - 11/25/2005

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?

By StrataFrame Team - 11/26/2005

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.
By Scott - 11/27/2005

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?

By Trent L. Taylor - 11/27/2005

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.
By Scott - 11/27/2005

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

By Trent L. Taylor - 11/28/2005

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.
By Scott - 11/28/2005

Here is a shot of the infobox.

By Scott - 11/28/2005

And here is the video info:

By Scott - 11/28/2005

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.

By StrataFrame Team - 11/28/2005

Thanks for the screen shots, Scott, we're in the process of figuring this one out Smile