.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Programmatically help with Contact Selector

Posted By:      Posted Date: September 20, 2010    Points: 0   Category :SharePoint

Hi Guys , i need a C# Method that inputs the AccountID of the Contact selector and Returns it's DisplayName please help me to do this

Thanks Meda

View Complete Post

More Related Resource Links

Contact Selector - Form tab index is lost after selector resolves names on blur


I'm working with an InfoPath2007 form developed to be filled-out through the browser on a SharePoint 2007 site, and I'm testing using Internet Explorer 7.  It's a straight-forward form, with a number of text fields and two Contact Selector controls.

The issue I'm encountering is with the Contact Selector control, where if the actor only enters a partial name into the text-field and then TABs away from the control the form will perform its auto-postback to look-up and resolve the partial name (showing the name resolution dialog is necessary), and afterward the actor's cursor is focused on the next field in the form.  The actor can type text into the focused field, but any subsequent pressing of the TAB key returns the actor's focus to the browser's ADDRESS bar, which is incorrect as it should proceed to the next field in the form.  I understand that the Contact Selector needs to perform its postback to perform the name resolution (so that there is no way through the InfoPath form designer to disable postbacks for the control), but why does the browser not know how to continue the TAB order of the fields on the form even when a field has focus?

Automatically populating Contact Selector not working in Form Services

Hi,I'm currently working on a form where i wan't to automatically populate a contact selector control with a users manager. I've got the managers userid, called the ResolvePrincipal webservice provided by sharpoint, and set all the values in the contact selector with the correct values. When previewing it works perfectly however when i move the form to Form Services it won't work.I've tried setting it via rules: i.e. on the change of a textbox write the manager values to the contact selector.I've tried setting the default values of the contact selector to fields where i write the manager values.I've tried setting it through code i.e. SelectSingleNode() and SetValue() for each of the fields in the contact selector.All of which work fine in preview mode but will not work in Form Services, UNLESS the contact selector already has a user in it. So if the contact selector is blank it won't work, however as soon as i manually select a user then try using any of the previously mentioned methods of setting the control it works. While using code i get a nullreferenceexception which leads me to think that possibly when theres no user in the control the xml nodes representing the AccountId, DisplayName, AccountType don't exit???? TO throw another spanner in the works, on the very odd occasion it will work in Form Services as expected, after celebrating and trying again it returns

Contact Selector Failed in MOSS Workflow Modification Infopath Form

Hi,   In my proof of concept Moss 2007 WF, I tested an Infopath modification form successfully.  Then the contact selector ActiveX control was added but it failed to open using the modification link of the workflow page.  In a different form for the WF initiation, I similarly created two CS controls and it worked there.  A snippet of the MOSS error is below   Object reference not set to an instance of an object.   at Microsoft.Office.InfoPath.Server.Controls.ContactPicker.RenderClientViewDataLeafContent(XPathNavigator context, IRenderContext renderContext, ControlViewData controlViewData, ScriptWriter writer)    at Microsoft.Office.InfoPath.Server.Controls.LeafControl.RenderClientViewDataContent(XPathNavigator context, IRenderContext renderContext, ScriptWriter writer)    at Microsoft.Office.InfoPath.Server.Controls.BaseControl.RenderClientViewData(XPathNavigator context, IRenderContext renderContext, ScriptWriter writer)    at Microsoft.Office.InfoPath.Server.Controls.ContainerControl.RenderClientViewDataContent(XPathNavigator context, IRenderContext renderContext, ScriptWriter writer)    at Microsoft.Office.InfoPath.Server.Controls.BaseControl.RenderClientViewData(XPathNavigator context, IRenderContext renderContext, ScriptWriter writer)    at Microsoft.Office.InfoPath.Server.Controls.CollectionControl.RenderClientViewDataContent(XPathNavigator context, IRenderContext rend

Problem Resolving More Than One Contact Selector

On a Forms Services form I have 3 contact selectors.  The form connects to SharePoint and creates an item in SharePoint based on code behind. The problem is that only one of the contact selectors resolves automatically.  If the user clicks into the contact selector field manually and tabs off the field then it will resolve but I need to automatically resolve all contact selectors before the user clicks a button on the form to add the items to SharePoint list. If the user does not click into the contact selector field then the username in the field does not become underlined (i.e. resolved) as a valid username. When debugging I can see that the XML behind the form is as follows: <my:AssignedToPersons> <my:Person> <my:DisplayName>Bloggs, John</my:DisplayName> <my:AccountId>DOMAIN\jbloggs</my:AccountId> <my:AccountType>User</my:AccountType> </my:Person> </my:AssignedToPersons> <my:ManagerPersons> <my:Person> <my:DisplayName>Bloggs, Bill</my:DisplayName> <my:AccountId></my:AccountId> <my:AccountType></my:AccountType> </my:Person> </my:ManagerPersons> <my:ManagerPersons> <my:Person> <my:DisplayName>Bloggs, Jim</my:DisplayName> <my:AccountId></my:AccountId> <my:AccountType></my:AccountType> </my:Person&

Set Contact selector rules in InfoPath when using DIP from SharePoint


I created a custom content type of type document in WSS 3.0. I created column called "person" of type "People or Group ". So when I create a new document in SharePoint, there is a contact selector (people picker) in document information panel . But I would like to use InfoPath to edit the contact selector in this way: When a person is picked in the contact selector, another field (also custom column from my content type) will be changed according to the person I picked. I hope it is clear :-)

But in InfoPath when I right click the contact selector, there is no Rules... option, even no Data validation option etc.

What can I do?

Thanks for any suggestions.

Contact selector InfoPath forms services


I want to filter users displayed in contact selector by group.

So, i don't want to display all users but only users in a special group

Checks on Contact Selector

Hi I want to create check on contact selector. Like if there is no value in contact selector then change the view. Can any body help me?

Infopath: Contact selector field



I am designing an infopath which is connected to an Access DB.

I need to have a "Contact selector" field in my Infopath, is this still possible without having a sharepoint server to connect to?

If yes, how can this be achieved?

Contact selector and custom xml schema



Because I want to reuse some parts, I build my forms with several "subs" xsd. Within these xsd files, I've defined at several places a structure to hold the contact selector internal data (DisplayName, AccoundType and AccountId within a repeatable group).

When I want to bind the contact selector to the sub schema element, it works in design, but not at runtime.

In the CS properies, It's written that the CS use the schema of the current form. Does that means I'm condemned to put all my contact selector element store in the top level schema, the form's one ?

Is there any way to "reuse" the contact schema ? I'm building serialization object behind the scene, and I don't wan't to have People1 People2, PeopleX for each form I have.


I'd appreciate any advice to unscramble my mind.



Paying back the community for its help by writing articles :
Have a Nice Day.Net Blog

Contact Selector in infopath (view Email also) sharepoint/infopath 2007


hi ,

first i want to know what is the benifit of contact Selector.

what is the best method to configure this.

and i want to view the Email(WorkEmail) with DisplayName,AccountId,AccountType.



Thanks and Regards Er.Pradipta Nayak

Export SharePoint List to Excel Spreadsheet Programmatically using C#

In SharePoint applications, Custom Lists are used to store business data and Document Libraries to store the documents. But for data manupulation and analysis, Microsoft Excel provides very rich features as compared to SharePoint Lists. That's why people still loves to work on Microsoft Excel Sheets.

Creating an Excel Spreadsheet programmatically using VB.NET

The Interoperability services make it very easy to work with COM Capable Applications such as Word and Excel. This article reveals using Excel from a managed application. Excel is the spreadsheet component of Microsoft Office 2000. The majority of Excel programmatic functionality is exposed through Automation via the type library Excel9.olb. The intention of this article is to express that a managed application can interrelate with Excel as a COM server.

Creating an Excel Spreadsheet and Adding Data to It Programmatically

The Interoperability services make it veryeasy to work with COM Capable Applications such as Word and Excel. Thisarticle reveals using Excel from a managed application. Excel is thespreadsheet component of Microsoft Office 2000. The majority of Excelprogrammatic functionality is exposed through Automation via the typelibrary Excel9.olb. The intention of this article is to express that amanaged application can interrelate with Excel as a COM server.

How to programmatically add controls to Windows forms at run time by using Visual C#

Create a Windows Forms Application
Start Visual Studio .NET or Visual Studio 2005 or a later version, and create a new Visual C# Windows Application project named WinControls. Form1 is added to the project by default.
Double-click Form1 to create and view the Form1_Load event procedure.
Add private instance variables to the Form1 class to work with common Windows controls. The Form1 class starts as follows:

using the linqDataSource control programmatically (dynamically)



my scenario is this: I want to use the linqDataSource control to bind data to a gridview for it's efficient built-in paging and sorting features *but* I don't want the data to be bound until the user has input various search parameters, so I need to bind the data from a button click event. Also, the search options will be somewhat complex in that there will be several optional search parameters, via various dropdowns and textboxes, so I can't just declaratively/statically setup all the WHERE parameters on the linqDataSource (at least I'm assuming I can't, or that it may result in poor performance if I do and just assign default values like the everything wildcard '%' for the cases the user doesn't use a particular search parameter). Given that brief description, here is an example of what I'm doing, but with only one WHERE parameter for simplicity, the real code will be adding anywhere from 1 to about 12 WHERE parameters depending on how the user sets the search options in the GUI.

the linqDataSource on the aspx page:

<asp:LinqDataSource ID="ldsMain" runat="server" 
        Select="new (field1, field2, field3, etc..)" 

How to insert Image (jpeg) into MS Word Programmatically using VB.NET


Hi there,

Can someone help me on How to insert Image (jpeg) into MS Word Programmatically using VB.NET..not C#.NET??? Sad

I could hardly find any articles for the coding. Preferably using Bookmark...can i have the sample code.



Advanced Basics: Set Word Document Properties Programmatically


At the beginning of another lovely day of writing courseware in mad pursuit of unrealistic deadlines, I received a frantic call from a business partner. He was at the end of a long consulting project and had several hundred Microsoft® Word documents, all of which required their document properties to be set identically, except the Title property of the document, which was to be based on the document file name, minus the .

Ken Getz

MSDN Magazine March 2006

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend