bbossi

Hello,

We are creating a custom control to enter time worked on a specific work item. I have the control created and displaying in the work item. If possible, I would like to capture the work item save event to save my time entry instead of having a separate save button within my control. However, it appears that "FieldChanged" is the only work item event that is available to me.

I've thought about leveraging the WorkItemChangedEvent from TFS somehow, but this feels a little too clunky.

Are there any other approached I am missing

Thanks in advance ... bbossi



Re: Team Foundation Server - Work Item Tracking Custom Control Question - Is there a way to capture the work item save 'event'?

Swamy Subramanian

You don't need any custom save logic to save the value in the custom control. You just need to set the appropriate workitem field (WorkItem object will bed passed to the control using IWorkItemControl.WorkItemDatasource). Take a look at the following blog post for more details on this

http://blogs.msdn.com/narend/archive/2006/10/02/How-to-use-Custom-Controls-in-Work-Item-Form.aspx

Hope this helps






Re: Team Foundation Server - Work Item Tracking Custom Control Question - Is there a way to capture the work item save 'event'?

bbossi

Thanks for the response. I need to give a little more detail on my end goal. I did use the blog from Naren to get me started. But in addiiotn to updating and saving a field on the work item that my control populates, my control is also updating a separate table outside of TFS. I'd like for the end user to kick off this process by saving the work item if possible - otherwise I will place a save button within the control itself.



Re: Team Foundation Server - Work Item Tracking Custom Control Question - Is there a way to capture the work item save 'event'?

Swamy Subramanian

In this case I would prefer subscribing to WorkItemChangedEvent and implement your custom logic on receiving a notification about this event. WorkItemChangedEvent will be fired only the WorkItem changes were saved successfully