index > Windows Workflow Foundation > Binding to an item within an array.

Binding to an item within an array.

Hi All,

I am wondering if it is possible to bind to a specific property of an object that I have in an array in an Activity. By default the designer will allow me to bind to the entire array, but is it possible to bind at a more granular level such as an array item, or a property of an item in the array.

For example imagine my activity class contains an array of type 'User'. The User object amongst other things has a string property called 'Username'. Is it possible for me bind a value to the Username field of an arbitary User object in the array?

Regards
Ben

Ben Vaughan

by default, you can bind to an item in the array, if the array items are the same type as your property. In your case, if your property was of type User, then you could bind to the Nth item in the array.

However, if you go into the designer.cs file for your workflow, you can edit the binding path so that you bind to the Nth User and then select the UserName property.

activitybind1.Name = "Workflow1;

activitybind1.Path = "Users[0].UserName";

Matt




See What You Can Learn -- http://www.pluralsight.com/courses/IntroducingWF.aspx
Matt Milner - Pluralsight
reply 2

You can use google to search for other answers

 

More Articles

• SQlDatabase Activity from this site (URGENT)
• Release Candidate is out...
• WWF bug reporting site
• What happened with WorkflowWebRequestContext ?
• Ownership supposed to be released during unload?
• Where is XmlnsDefinition?
• Painting activity with WPF?
• How to design on WF the back to activity?
• SerializationException while Persisting inside UnloadInstance Met...
• faultHandlerActivity.Fault is always null
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• Sequential Workflow - Go to activity
• Problem with Lab11 Exercise 2
• Package Load Failure
• WorkflowMarkupSerializer: The Writer is
• How to implement Unit test in a Sequenti
• Help Desk Support Sample APp does not co
• WebServiced published Workflows.
• workflow compiler with RuleconditionRefe
• How to handle errors in EventSinkActivity?
• How do I get the workflowRuntime from th
• CreateWorkflow() - where is it?
• How to make a custom composite activity
• Debugging asp.net application gives a st
• Help! a confused trouble about my cumsto
• How to convert .dll back to .xoml?

Hot Articles

• How can I get the type at design time of
• Add Graphic User Interface to custom Act
• Correct way to configure SQlPersistence
• Usage of WWF in a .NET 2.0 app?
• How is WWF Store Persitant Workflow Info
• Workflow Parameters and Activity Propert
• Workflow Exception
• InfoPath Task form not pre-filling
• WebServiceInput Activity Error: Paramete
• Validating wich activities I can insert
• Adding activities to a workflow at runtime
• Validation Fails on Build
• Custom Activity State Deserialization Pr
• K2 captaris Vs Windows workflow
• Error in the Hands on lab 09

Recommend Articles

• Custom Activity Causes Workflow Validati
• DependencyProperty error...
• What does this exception message ["
• Active Directory Role example
• Tracking Service
• starting questions...
• Mail to James Conrad
• Wait until time/Persistence & Tracking
• Winforms and workflow events
• How to get possible state transition for
• Best workflow approach?
• Debugging in the designer when triggerin
• How to change the padding of Activity de
• Chainig Workflows Synchronously: InvokeW
• data exchange between workflow activities