INFOPATH 2007 SwitchView in XmlFormView Aspx Page - InfoPath Dev
in

InfoPath Dev

INFOPATH 2007 SwitchView in XmlFormView Aspx Page

Last post 03-20-2007 03:47 PM by Matt Faus. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-08-2007 01:37 AM

    INFOPATH 2007 SwitchView in XmlFormView Aspx Page

    INFOPATH 2007:
    Hello,
    I have created a custom .aspx page and placed a XMLFORMVIEW control on it. I want to switch the view in XMLFormView control hosting an infoPath template programitically.
    I tried to write the following line in Onload and Initilize on XMLFormView Control. The code is

    XmlFormView1.XmlForm.ViewInfos.SwitchView("Approver1");

    This is returning an "Object Reference not set to an instance of an object" error. Any ideas?

    Please help.

    Thanks
  • 03-20-2007 03:47 PM In reply to

    Re: INFOPATH 2007 SwitchView in XmlFormView Aspx Page

    You cannot use this method to switch views in OnLoad. To switch views in this event handler you have to set the default view of the form, then when OnLoad finishes that view will be displayed.

    I'm not sure of the exact syntax of this command but it should be something like:

    XmlFormView1.XmlForm.ViewInfos["Approver1"].IsDefault = true;
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.