I was just wrapping up my testing and thought I would check back on the forums. Greg...thanks for responding so quickly! You and I were thinking a lot alike this afternoon. I pretty much did what you provided as an example. I did a couple of things differently. The first was the LaunchDialog method syntax. Mine looks like this:
public void LaunchDialog(Type dialogType, params object[] pParameters)
The second was to (as you see in the snippet above) was to make the method
public. From the MDI child dialog window, I need to call this method in the MDI parent form. That was the easiest way for me to do it. So, my resulting method call in the dialog looks like this:
private void OpenMaintenanceWindow()
{
if (gridView1.SelectedRowsCount > 0)
{
int mIndex = (int)gridView1.GetFocusedRowCellValue("DEX_ROW_ID");
PurchasingMain mForm = (PurchasingMain)ParentForm;
mForm.LaunchDialog(typeof(VendorMaintenance), mIndex);
}
}
I am using a DevEx grid to display the vendors. Either a double-click on the vendor in the grid, or a click of the dynamic action menu item will call this method and open the maintenance window directly to the vendor ready to be maintained.
I did handle the actual maintenance window's constructor slightly differently, too. Here is what I put together:
private int _vendorindex;
public VendorMaintenance() : this(0) { }
public VendorMaintenance(int pVendorIndex)
{
_vendorindex = pVendorIndex;
InitializeComponent();
}
private void VendorMaintenance_Load(object sender, EventArgs e)
{
CreateSaveUndo();
if (_vendorindex > 0)
{
vendorsBO1.FillByPrimaryKey(_vendorindex);
}
}
I am trying to override the Save/Undo auto creation in the action menu. Haven't quite got that right, yet. The rest seems to be working out quite well.
Almost time for that R&R...