obtaining a reference to a workitem from SmartPart

Topics: CAB & Smart Client Software Factory
Feb 1, 2006 at 6:51 AM
originally posted by: GregHazzard

I have a SmartPart (View) which is launched from its parent DeckWorkSpace via CustomerWorkItem activation.

My problem is that when I handle a DataGridView click event in that SmartPart, I can't get the handle to the workitem. (any workitem or controller)

I want to call a method contained in a controller to another SmartPart (the detailview) which itself will be launched from another DeckWorkspace on the bottom side of a splitter.

How do I get access to a WorkItem (in this case the CustomerWorkItem) or controller through the object hierarchy once I am in the SmartPart? I can't seem to obtain any object references to the workitems (or controllers) to achieve this.

I thought that by including

public CustomerDetailController DetailController
get { return detailcontroller; }
set { detailcontroller = value; }

in the partial class CustomerGridView that I would have the services of this Controller which contains the method

public void WorkWithCustomerDetail()


Does this question make sense?

Feb 1, 2006 at 8:19 AM
originally posted by: GregHazzard

not sure if this is the way to move from the view back to the workitem that instantiated it in the first place but I'll take what I can get for now. ;-)

CustomerWorkItemEdit c = new CustomerWorkItemEdit();
Feb 1, 2006 at 1:26 PM
originally posted by: GregHazzard

i got rid of a layer of workitems to solve this. I think what I learned is that childworkitems deactivate the baseworkitem in this case and I lost the important objects I needed.