Hi,
How do I limit the Contact Selector control so the user can only select a single person?
I referred to the below blog, but when I remove the second users is, the error (with the red border) still persists
http://blogs.msdn.com/infopath/archive/2007/02/28/using-the-contact-selector-control.aspx
I have implemented below code for limiting the control
public void group1_Validating(object sender, XmlValidatingEventArgs e)
{
if (e.Operation == XmlOperation.Insert)
{
if (e.Site.SelectChildren(XPathNodeType.Element).Count > 1)
{
e.ReportError(e.Site, false, "User Selection Error!", "Only 1 user can be selected!");
}
}
}
Is there any issue with the code?
Regards,
Vipul Mehta