Issue concerning CurrentView.SelectNodes - InfoPath Dev
in

InfoPath Dev

Issue concerning CurrentView.SelectNodes

Last post 03-03-2009 07:08 AM by Jimmy. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-03-2009 06:43 AM

    • JohanB
    • Not Ranked
    • Joined on 02-20-2009
    • Posts 7

    Issue concerning CurrentView.SelectNodes

    Hello again,

     I know I'm kinda spamming this forum last days, but I'm rather new to infopath development.

    I met up with a weird issue. When using the CurrentView (XmlFormHostItem.CurrentView) I only get one possibily (being the ViewInfo and 4 other standard things like tostring etc) But not SelectNodes, or anything.

     I checked wether my includes were correct, and they are, although as far as my knowledge goes.

    These are the includes:

    using System.IO;
    using Microsoft.Office.InfoPath;
    using System.Collections.Generic;
    using System;
    using System.Xml;
    using System.Xml.Serialization;
    using System.Xml.XPath;
    using fc = CVForm.FormsCommunicator;
    using Communicator = CVForm.FormsCommunicator.Communicator;

     I hope someone can help solving this issue.

    I like to change the data within a Repeating Section and I get a NullReferenceException when i just refer to the XPath of the fields. I also would like to add new rows. And SelectNodes would be handy to use to accomplish at least a part of this whole task.

     Kind regards,

     Johan Beerden

  • 03-03-2009 07:08 AM In reply to

    Re: Issue concerning CurrentView.SelectNodes

    This appears to be the case with browser enabled forms.  If your form is going to be browser enabled, you may need to come up with another way of adding rows to the repeating section.  The method in this post is a bit trickier, but may work for your particular situation.

     CurrentView.SelectNodes() is for changing the nodes that are selected within the UI.  To modify repeating section data within code, you need to use MainDataSource.CreateNavigator().Select() or something along those lines.  If the XPath you're using is coming back with null values, then you need to figure out what's wrong with your XPath.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.