Link to home
Start Free TrialLog in
Avatar of JordanBlackler
JordanBlackler

asked on

Sharepoint PeopleEditor control problem...

Hi All -
I'm using C#.

I have a people editor control on my form. There are two buttons that go with the control, A check name button and a browse button. I'm trying to access the check name button Programmatically but i'm not exactly sure how.
The line below works with a standard button:
btnAdd_Click(btnAdd, new System.EventArgs());

Any suggestions?
Avatar of Warpseh
Warpseh
Flag of Argentina image

I don't completely understand what you are trying to do, but, i think this may help: CheckButton.PerformClick(), if it doesn't, please tell me a little more of what you want to accomplish.
Avatar of JordanBlackler
JordanBlackler

ASKER

Instead of manually clicking the "check name" button i want to be able to write code that will act as if someone was actually clicking the "check name" button.

Does that make any sense?

On Page_Load I populate the people editor textbox with a name, then i want to be able check to see if it is a valid name (using the check name button)
Have you tried the CheckNameButton.PerformClick()? It should work in that case.
Oh alright..
What would come before CheckNameButton.PerformClick();
The name of my people editor is:
peopleEditorFCRO
The PerformClick() makes the button click, so, if you are handling the event of the button to check the name in the textbox, just fill the textbox before doing the performclick and it should work.
This is how i populate it:
strFinancialContactRO = "Smith, Joe";
PickerEntity entity = new PickerEntity();
entity.Key = strFinancialContactRO;
System.Collections.ArrayList entityArrayList = new System.Collections.ArrayList();
entityArrayList.Add(entity);
peopleEditorFCRO.UpdateEntities(entityArrayList);

Then i guess i would would use PeformClick()

But i'm not sure how to do that, could you use some code in an example?
 
ASKER CERTIFIED SOLUTION
Avatar of Warpseh
Warpseh
Flag of Argentina image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial