Community
Showing results for 
Search instead for 
Do you mean 
Reply

How can i bind contact list to datagridview

Employee
Posts: 2
Country: USA

How can i bind contact list to datagridview

HI there,

 

I have created a function to retrieve contactlist. i try to set datasource of datagridview to this contact list, and no result.

How can i bind the lists to datagridview.

 

Thank you in advance! 

Copper Super Contributor
Posts: 59
Country: USA

Re: How can i bind contact list to datagridview

Hi,

 

My guess is that you are not adding the field descriptors to the contactlist before adding it to the datasource, here's how I would do it: 

 

Dim fdFirstName As ContactFieldDescriptor = FW.Contacts.GetFieldDescriptor("TBL_CONTACT.FIRSTNAME", True)Dim fdLastName As ContactFieldDescriptor = FW.Contacts.GetFieldDescriptor("TBL_CONTACT.LASTNAME", True)Dim cl As ContactList = FW.Contacts.GetContacts(Nothing)cl.FieldDescriptors.Add(fdLastName)cl.FieldDescriptors.Add(fdFirstName)Me.grdContacts.DataSource = cl

Hope it helps

 

 

Hugo Vale
Datastream Custom Solutions
http://www.datastreamcs.com
Employee
Posts: 2
Country: USA

Re: How can i bind contact list to datagridview

Awesome!

 

It works now and thank you so much, Vale