Limiting the Contact Seletor control for selecting only 1 user - InfoPath Dev
in

InfoPath Dev

Limiting the Contact Seletor control for selecting only 1 user

Last post 06-19-2008 06:18 AM by mehtavipulk. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 06-19-2008 06:18 AM

    Limiting the Contact Seletor control for selecting only 1 user

    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

    Vipul Mehta
Page 1 of 1 (1 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.