Search code examples
c#sharepointinfopath

Infopath 2007 - How to set ScreenTip programmatically in C# code behind?


I need to set up infopath screentip programmatically in infopath code behind. I read something about this that it is impossible but, i made something like this:

        XPathNavigator field1 = MainDataSource.CreateNavigator().SelectSingleNode(xpath1, NamespaceManager);

        XPathNavigator field2 = MainDataSource.CreateNavigator().SelectSingleNode(xpath2, NamespaceManager);

        if (field1.Value.ToString() == "none")
        {

            this.Errors.Add(field2, "XXX", "XXxxxXX", "xxXXxxXX");

        }

but still i change the field to "cannot be blank" any clue ?


Solution

  • I created button and special field with hide when value = true , and show when is true.

    public void CTRL32_7_Clicked(object sender, ClickedEventArgs e) { // XPathNavigator test = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:field11", NamespaceManager);

            XPathNavigator test2 = MainDataSource.CreateNavigator().SelectSingleNode("my:myFields/my:buttonSet", NamespaceManager);
            if (test2.Value == "FALSE")
            {
                test2.SetValue("TRUE");
            }
            else
            {
                test2.SetValue("FALSE");
            }
            XPathNavigator tooltip = MainDataSource.CreateNavigator().SelectSingleNode("my:myFields/my:tooltip", NamespaceManager);
            tooltip.SetValue("Custom Tooltip DEMO");
        }