Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MmToolStripButtonNew not behaving like mmButtonNew
Message
From
12/07/2006 21:18:44
 
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
MmToolStripButtonNew not behaving like mmButtonNew
Miscellaneous
Thread ID:
01135905
Message ID:
01135905
Views:
56
I'm using mmMaintenanceForm (which has a mmButtonNew on it...).

I've added a mmToolStripButtonNew to the navToolStrip.

Clicking on the mmToolStripButtonNew adds a new row, and switches to the edit page, but doesn't navigate to the new row.

mmMaintenanceForm.cs has custom btnNew navigation code:
/// <summary>
/// Call the NavigateData method so the toolbar and navigation control
/// are properly updated to the last position of the newly added record
/// </summary>
protected virtual void btnNew_Click(object sender, System.EventArgs e)
{
  // Only navigate if the navigation controls' business object
  // is the same as the object we're adding a DataRow to
  if (this.NavControl != null &&
    (this.GetBizObj(this.NavControl.BindingSource) == 
       this.btnNew.GetBizObj()))
  {
    if (btnNew.GetBizObj(this) == 
      this.GetBizObj(this.NavControl.BindingSource))
      {
        // Determine if bound to a DataTable or DataView	
        string TableName, ViewName;
        mmBindingStrategyBase.GetBindingSource(this.btnNew.BindingSourceMember,
          out TableName, out ViewName);
        if (mmString.Empty(ViewName))
          // Bound to a DataTable...Navigate to the last record
          this.NavigateData(mmNavigate.Last, false);
        else
          // Bound to a DataView...Navigate to the first record
           this.NavigateData(mmNavigate.First, false);
      }
    }
  // Select the specified edit page
  this.SelectEditPage();
}
Should this nav code be tied to the mmToolStripButtonNew for mmMaintenanceForms, and how?

Thanks!
Next
Reply
Map
View

Click here to load this message in the networking platform