Showing results for 
Search instead for 
Do you mean 

WPF Bind to Contact

Copper Contributor
Posts: 42
Country: Germany

WPF Bind to Contact



I am just testing out some WPF stuff with ACT. Actually I'd like to bind a ContactList to a DataGrid.

What's working so far is to bind to the "FullName"-Property of the Contacts in the List but I have no clue how to bind to the user-fields which are accessed via the FieldCollection of a Contact, e.g.

Act.Framework.Contacts.Contact c;
=Act.UI.ActApplication.Instance.ApplicationState.CurrentContact; System.Console.WriteLine((string)c.Fields["USER6",Act.Framework.MutableEntities.FieldNameType.Alias]);

My XAML which is working for the "FullName":

        <DataGrid x:Name="dg1">
                <DataGridTextColumn Binding="{Binding FullName}"/>
                <!--Trying to bing to the USER6-Field, which is not working
                <DataGridTextColumn Binding="{Binding Fields["USER6",Act.Framework.MutableEntities.FieldNameType.Alias]}"/>

 I set the DataGrid's ItemsSource via:

Act.Framework.Lookups.ContactLookup cLookup=Act.UI.ActApplication.Instance.ActFramework.Lookups.LookupContactsReplace(@"SELECT TOP 1 CONTACTID FROM TBL_CONTACT",false,false);
Act.Framework.Contacts.ContactList cList=cLookup.GetContacts(null);

So does anybody have some idea, how one could bind to these user-defined fields?

Could it just be some adjustment to the XAML-Syntax to wrap the parenthesis and the quotes?