<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Populate ListBox from SharePoint</title><link>https://www.infopathdev.com:443/forums/thread/6601.aspx</link><pubDate>Mon, 04 Apr 2005 13:02:11 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:6601</guid><dc:creator>Shanthi Reddy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/6601.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=6601</wfw:commentRss><description>Hello Maggie,&lt;br /&gt;   Sorry for the late reply. Here is a brief explanation of the code. &lt;br /&gt;&lt;br /&gt;SharepointListAdapter oSpla =&lt;br /&gt;(SharepointListAdapter)thisXDocument.DataAdapters["SharePoint Adapter"];&lt;br /&gt;string sUrl = oSpla.SiteUrl;&lt;br /&gt;&lt;br /&gt;This code is used to get the URL from where you want to get the data.&lt;br /&gt;&lt;br /&gt;IXMLDOMDocument2 oDom =&lt;br /&gt;(IXMLDOMDocument2)thisXDocument.GetDOM("SharePoint Adapter ");&lt;br /&gt;oDom.setProperty("SelectionNamespaces",&lt;br /&gt;"xmlns:dfs=\"http://schemas.microsoft.com/office/infopath/2003/dataFormSolut&lt;br /&gt;ion\"");&lt;br /&gt;string sTitle =&lt;br /&gt;oDom.selectSingleNode(string.Format("//dfs:SharePointAdapter[@Title=\"{0}\"]&lt;br /&gt;/@Title", sStandardTitle)).text;&lt;br /&gt;&lt;br /&gt;string sFilename = sUrl + sSP_HEADTRAX_FOLDER + sTitle;&lt;br /&gt;&lt;br /&gt;This code is used to get the DOM for this data connection and then get the sTitle (that is the filename of one of the files in that form library) based on one of the node values being equal to "sStandardTitle" and it gets the full path to this xml file.&lt;br /&gt;&lt;br /&gt;IXMLDOMDocument2 oXml =&lt;br /&gt;(IXMLDOMDocument2)thisXDocument.CreateDOM();&lt;br /&gt;oXml.async = false;&lt;br /&gt;oXml.load(sFilename);&lt;br /&gt;oXml.setProperty("SelectionNamespaces",&lt;br /&gt;"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"&lt;br /&gt;xmlns:rd=\"http://www.microsoft.com/WorldwideSalesOperations/Roles/Definitio&lt;br /&gt;ns/2004/Role\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\"&lt;br /&gt;xmlns:my=\"http://schemas.microsoft.com/office/infopath/2003/myXSD/2004-02-0&lt;br /&gt;4T17:30:19\"&lt;br /&gt;xmlns:xd=\"http://schemas.microsoft.com/office/infopath/2003\"");&lt;br /&gt;&lt;br /&gt;This code creates a DOM called oXml and loads the data in the file whole full path we got above.&lt;br /&gt;&lt;br /&gt;IXMLDOMNode oNewNode =&lt;br /&gt;oXml.selectSingleNode("//rd:Roles/rd:Role//" + oExistingNode.nodeName);&lt;br /&gt;oParentNode.replaceChild(oNewNode.cloneNode(true),&lt;br /&gt;oExistingNode);&lt;br /&gt;&lt;br /&gt;This code then gets the data in that file and then replaces data in the Main DOM with this data. There is most probably a dropdown list box which gets data from these nodes.&lt;br /&gt;&lt;br /&gt;If you just want to populate a dropdown list box with data from a Sharepoint list (like its file name or any other promoted properties) then you can do this &lt;br /&gt;1. Create a data connection to the Sharepoint form library&lt;br /&gt;2. Insert a dropdown list box in the view and go to its properties window and choose the third radio button to get data from a data connection. Choose the appropriate data connection and the value that you want to show in the dropdown.&lt;br /&gt;&lt;br /&gt;Hope this helps!&lt;br /&gt;&lt;br /&gt;Shanthi&lt;br /&gt;InfoPathDev India</description></item><item><title>Re: Populate ListBox from SharePoint</title><link>https://www.infopathdev.com:443/forums/thread/6600.aspx</link><pubDate>Wed, 30 Mar 2005 01:02:44 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:6600</guid><dc:creator>potpourri</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/6600.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=6600</wfw:commentRss><description>i got it from you of course :)</description></item><item><title>Re: Populate ListBox from SharePoint</title><link>https://www.infopathdev.com:443/forums/thread/6599.aspx</link><pubDate>Tue, 29 Mar 2005 23:29:00 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:6599</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/6599.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=6599</wfw:commentRss><description>Hi Maggie,&lt;br /&gt;How did you get that code?&lt;br /&gt;Cheers,&lt;br /&gt;Patrick&lt;br /&gt;&lt;br /&gt;Patrick Halstead [InfoPath MVP]&lt;br /&gt;InfoPathDev</description></item><item><title>Populate ListBox from SharePoint</title><link>https://www.infopathdev.com:443/forums/thread/4587.aspx</link><pubDate>Wed, 16 Mar 2005 03:18:23 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:4587</guid><dc:creator>maggie</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/4587.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=4587</wfw:commentRss><description>I got this segment of code about how to populate a list box from a share point list. But I'm having a hard time in understanding it...Could anyone be kind enough to explain it to me how it works?&lt;br /&gt;&lt;br /&gt;&lt;blockquote id="quote"&gt;&lt;font size="1" face="Verdana, Arial, Helvetica" id="quote"&gt;quote:&lt;hr height="1" noshade id="quote"&gt;&lt;br /&gt;SharepointListAdapter oSpla =&lt;br /&gt;(SharepointListAdapter)thisXDocument.DataAdapters["SharePoint Adapter"];&lt;br /&gt;        string sUrl = oSpla.SiteUrl;&lt;br /&gt;&lt;br /&gt;        IXMLDOMDocument2 oDom =&lt;br /&gt;(IXMLDOMDocument2)thisXDocument.GetDOM("SharePoint Adapter ");&lt;br /&gt;        oDom.setProperty("SelectionNamespaces",&lt;br /&gt;"xmlns:dfs=\"http://schemas.microsoft.com/office/infopath/2003/dataFormSolut&lt;br /&gt;ion\"");&lt;br /&gt;        string sTitle =&lt;br /&gt;oDom.selectSingleNode(string.Format("//dfs:SharePointAdapter[@Title=\"{0}\"]&lt;br /&gt;/@Title", sStandardTitle)).text;&lt;br /&gt;&lt;br /&gt;        string sFilename = sUrl + sSP_HEADTRAX_FOLDER + sTitle;&lt;br /&gt;        IXMLDOMNode oParentNode = getNode("//rd:Roles/rd:Role");&lt;br /&gt;        IXMLDOMNode oNode = getNode("//rd:Roles/rd:Role/rd:HeadTrax");&lt;br /&gt;&lt;br /&gt;        getSharePointFileData(sFilename, oParentNode, oNode);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;private bool getSharePointFileData(string sFilename, IXMLDOMNode&lt;br /&gt;oParentNode, IXMLDOMNode oExistingNode)&lt;br /&gt;{&lt;br /&gt;        if("" == sFilename || null == oParentNode || null == oExistingNode)&lt;br /&gt;                return false;&lt;br /&gt;&lt;br /&gt;        try&lt;br /&gt;        {&lt;br /&gt;                IXMLDOMDocument2 oXml =&lt;br /&gt;(IXMLDOMDocument2)thisXDocument.CreateDOM();&lt;br /&gt;                oXml.async = false;&lt;br /&gt;                oXml.load(sFilename);&lt;br /&gt;                oXml.setProperty("SelectionNamespaces",&lt;br /&gt;"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"&lt;br /&gt;xmlns:rd=\"http://www.microsoft.com/WorldwideSalesOperations/Roles/Definitio&lt;br /&gt;ns/2004/Role\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\"&lt;br /&gt;xmlns:my=\"http://schemas.microsoft.com/office/infopath/2003/myXSD/2004-02-0&lt;br /&gt;4T17:30:19\"&lt;br /&gt;xmlns:xd=\"http://schemas.microsoft.com/office/infopath/2003\"");&lt;br /&gt;&lt;br /&gt;                IXMLDOMNode oNewNode =&lt;br /&gt;oXml.selectSingleNode("//rd:Roles/rd:Role//" + oExistingNode.nodeName);&lt;br /&gt;                oParentNode.replaceChild(oNewNode.cloneNode(true),&lt;br /&gt;oExistingNode);&lt;br /&gt;&lt;br /&gt;                return true;&lt;br /&gt;        }&lt;br /&gt;        catch(Exception ex)&lt;br /&gt;        {&lt;br /&gt;                return false;&lt;br /&gt;        }&lt;br /&gt;}&lt;br /&gt;&lt;hr height="1" noshade id="quote"&gt;&lt;/font id="quote"&gt;&lt;/blockquote id="quote"&gt;&lt;br /&gt;&lt;br /&gt;Thanks in advanced!</description></item></channel></rss>