Print Page | Close Window

EditorController

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=434
Printed Date: 13-Apr-2026 at 5:18am


Topic: EditorController
Posted By: orcities
Subject: EditorController
Date Posted: 18-Sep-2007 at 2:38pm
In the Orders Master tab you can add/delete/modify the current item by clicking the buttons in the NavBar.
 
I can not see how this is implemented. Can you explain. Do I have to create a seperate module for the controls I wish to use this.
 
I see in Module.cs file that it's Service Dependency is not WorkItem but IEntityEditorService.



Replies:
Posted By: Bill Jensen
Date Posted: 18-Sep-2007 at 4:41pm
In the Orders Master tab you can add/delete/modify the current item by clicking the buttons in the NavBar.  I can not see how this is implemented. Can you explain. Do I have to create a seperate module for the controls I wish to use this.
 
This is buried pretty deep. 
 
Since the customer orders display is part of a tab view, it is controlled by a TabViewController, the "CustomerOrdersTabViewController".  This ultimately inherits from MasterDetailTabViewController which inherits from MasterDetailTabViewControllerBase.  Here we find the method "ConfigureMasterViewContext":
 
(Sorry about the double spacing)

/// <summary>Configure the Master Grid's ViewContext per the standard defaults.</summary>

/// <remarks>

/// This implementation configures the master grid to show

/// its toolstrip, be readonly, and support add, delete, and edit of rows.

/// Row double-click launches an editor for the current row.

/// </remarks>

protected virtual void ConfigureMasterViewContext() {

mMasterViewContext.GridViewToolStripVisible = true;

mMasterViewContext.ReadOnly = true;

RegisterMasterCommandHandler(CommandNames.AddNew, AddNewCommandHandler<TMaster>);

RegisterMasterCommandHandler(CommandNames.Delete, DeleteCommandHandler<TMaster>);

RegisterMasterCommandHandler(CommandNames.Edit, EditCommandHandler<TMaster>);

mMasterViewContext.RowDoubleClickCommandName =

mMasterViewContext.MakeViewSpecificId(CommandNames.Edit);

}

Since this method is protected virtual, you could override it in your TabViewController to obtain different behavior.
 
 
 
I see in Module.cs file that it's Service Dependency is not WorkItem but IEntityEditorService.
 
I see this in SharedEditorModule.cs.  It simply means that the SharedEditor module needs access to the EditorService in order to register itself for access by other modules.  It doesn't need access to any workitem.
 
Does this help?
 
Bill J.


Posted By: orcities
Date Posted: 19-Sep-2007 at 9:09am

How do I do it if I do not want to use the MasterDetailTab.



Posted By: Bill Jensen
Date Posted: 19-Sep-2007 at 12:08pm

You'll need to walk through the code of MasterDetailTabViewController base, understand what it's doing, and do the same thing in your page or tab view controller.

Bill J.




Print Page | Close Window