Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ToolStrip buttons don't fire TextBox Leave events
Message
From
06/07/2006 18:36:10
 
 
To
28/06/2006 14:44:07
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01132234
Message ID:
01134311
Views:
23
Thanks Tony,

I think this way might be simpler with the way I'm already doing things.

I'm using a form that inherits from mmMaintenanceForm, so I override NavigateData(). This takes care of the default navbar:
        /// <summary>
        /// Sets the main form's nav toolbar buttons, then passes the business object's
        /// current DataRowView to the primary business object's Navigate method.
        /// </summary>
        /// <param name="navPosition">Position to navigate to</param>
        public override void NavigateData(mmNavigate navPosition)
        {
            // capture last edit, if any
            this.Validate();

            base.NavigateData(navPosition);
        }
I've also created my own buttons, inherited from mmToolStripButton[Save, Cancel, ...]
as I'm contemplating form "edit" state enabling and disabling (if no change, save button disabled, until a change, then enabled) I'm redoing a legacy app, and the users have some UI expectations.

Anyway, I'm overriding the mmToolStripButtonSave_Click event to get the Validate() in there.
    /// <summary>
    /// Save button
    /// </summary>
    public partial class myToolStripButtonSave : mmToolStripButtonSave
    {
        ...

        /// <summary>
        /// custom save
        /// </summary>
        protected override void mmToolStripButtonSave_Click(object sender, EventArgs e)
        {
            // Get a reference to the parent business form
            mmBusinessBaseForm ParentForm = 
               mmAppDesktop.FormMgr.GetParentBusinessForm(this);

            if (ParentForm != null)
            {
                // validate the form to get the current field's data
                ParentForm.Validate();

                base.mmToolStripButtonSave_Click(sender, e);                
            }
        }

        ...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform