Error: 'System.Xml.Linq.XDocument' does not contain a definition for 'View' - InfoPath Dev
in

InfoPath Dev

Error: 'System.Xml.Linq.XDocument' does not contain a definition for 'View'

Last post 02-16-2012 08:51 AM by venkatzeus. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 02-16-2012 04:13 AM

    Error: 'System.Xml.Linq.XDocument' does not contain a definition for 'View'

     Hi,

    I am using browser based InfoPath 2010 form.

    I am trying to set the focus programmatically is VSTS.

    I tried the below code:

    [CODE]

     XPathNavigator id = MainDataSource.CreateNavigator();

           XPathNavigator nodeSelText = id.SelectSingleNode("/my:1aVerified/my:WC/my:WCOther/my:WCOther2/my:WCOtherInGrp/my:field1",NamespaceManager);

                XDocument.View.SelectNodes(nodeSelText);

    [/CODE]

    I am getting error as "'System.Xml.Linq.XDocument' does not contain a definition for 'View' ".

    How to fix this?

    Thank you

  • 02-16-2012 04:24 AM In reply to

    Re: Error: 'System.Xml.Linq.XDocument' does not contain a definition for 'View'

    I believe that in 2007 code, it would be CurrentView, not XDocument.View.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 02-16-2012 04:30 AM In reply to

    Re: Error: 'System.Xml.Linq.XDocument' does not contain a definition for 'View'

     Hi,

    yes there is currentview. But how to change the code for the below line:

    XDocument.View.SelectNodes(nodeSelText);

  • 02-16-2012 04:50 AM In reply to

    Re: Error: 'System.Xml.Linq.XDocument' does not contain a definition for 'View'

    Looks like you need to use an XPathNavigator to select the node you want to highlight first, and then pass that to SelectNodes(). 

     http://msdn.microsoft.com/en-us/library/aa946814.aspx

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 02-16-2012 05:05 AM In reply to

    Re: Error: 'System.Xml.Linq.XDocument' does not contain a definition for 'View'

     Hi,

    Thank you very much for the reply.

    But could you please provide the code change for:

    XDocument.View.SelectNodes(nodeSelText);

  • 02-16-2012 05:21 AM In reply to

    Re: Error: 'System.Xml.Linq.XDocument' does not contain a definition for 'View'

    It's not a direct conversion. Please consult the example on the link I provided.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 02-16-2012 08:51 AM In reply to

    Re: Error: 'System.Xml.Linq.XDocument' does not contain a definition for 'View'

    Hi,

    I checked the link and used the code provided.

    However, in the below line:

    CurrentView.SelectNodes(repeatingTableRow1);
    I am not able to get the property selectNodes for CurrentView.

    CurrentView is having the below:

    CurrentView.Equals | GetHashCode | GetType | ToString | ViewInfo

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