Set focus on the contact selector "DisplayName" field - InfoPath Dev
in

InfoPath Dev

Set focus on the contact selector "DisplayName" field

Last post 07-12-2010 10:50 PM by colacat. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 07-12-2010 05:18 AM

    Set focus on the contact selector "DisplayName" field

    I'm desperate need of help!

    I try to set the focus on the "DisplayName" field of a contact selector in InfoPath 2007 using C# code. I'm not much of a programmer but I found some code.

    // Create XPathNavigator and select field.
    XPathNavigator textNode =  CreateNavigator().SelectSingleNode("/my:myFields/my:field1", NamespaceManager);

    // Select text in specified field.
    CurrentView.SelectText(textNode);

     

    This is supposed to work with C#, but CurrentView does not know the SelectText definition ?

    Does anybody have a good piece of code to make the focus point to the "DisplayName" field.

    Thank you!! 



     

  • 07-12-2010 03:32 PM In reply to

    Re: Set focus on the contact selector "DisplayName" field

    Is your form browser compatible? I found that "SelectText" was not available for browser forms but is for client forms....

    Hilary Stoupa

  • 07-12-2010 10:50 PM In reply to

    Re: Set focus on the contact selector "DisplayName" field

    Correct  ...and it indeed works when changing the Compatibility Settings. 

    I guess then there is no way to set focus in a browser enabled form... 

    Thanks!

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