<?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>Controls</title><link>https://www.infopathdev.com:443/forums/43.aspx</link><description> </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: C# should fill IP DropDownList</title><link>https://www.infopathdev.com:443/forums/thread/11993.aspx</link><pubDate>Fri, 08 Dec 2006 00:52:00 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:11993</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/11993.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=11993</wfw:commentRss><description>Again, you only modify nodes and node values -- not controls. When dealing with a DDL, you are dealing with the node that the DDL control is "bound" to--not the control itself. Thus if you modify the value of that node that your DDL is bound to, you modify the selected value of that DDL.&lt;br /&gt;&lt;br /&gt;What you need to do is create a secondary data source (i.e. an XML file) that has a repeating list in it... something like:&lt;br /&gt;&lt;br /&gt;&amp;lt;ColumnNames&amp;gt;&lt;br /&gt;   &amp;lt;ColumnName/&amp;gt;&lt;br /&gt;   &amp;lt;ColumnName/&amp;gt;&lt;br /&gt;&amp;lt;/ColumnNames&amp;gt;&lt;br /&gt;&lt;br /&gt;Create a new data connection to this XML file. Then set up your drop-down list control to get its values from this new data connection.&lt;br /&gt;&lt;br /&gt;Okay, now your drop-down list will have two blank values in it. Why did I list ColumnName twice? So that the auto-generated schema will list that node as repeating.&lt;br /&gt;&lt;br /&gt;With this all in place, now you must write some code to delete the two default blank ColumnName nodes from your data connection, and the add in ColumnName nodes populated with the names of your MOSS list columns. Once you've inserted a ColumnName node for each actual column, populated with the name of said columns, then your drop-down list will correctly display the column names in the DDL.&lt;br /&gt;&lt;br /&gt;The node you bind your DDL control to is the node that will contain the user's selected value.&lt;br /&gt;&lt;br /&gt;I hope that helps to clarify the process.</description></item><item><title>Re: C# should fill IP DropDownList</title><link>https://www.infopathdev.com:443/forums/thread/11992.aspx</link><pubDate>Thu, 07 Dec 2006 15:00:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:11992</guid><dc:creator>Kun</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/11992.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=11992</wfw:commentRss><description>&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;You don't alter any "control" in InfoPath -- only DOM nodes.&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;Yes, that's right. But a control is in a DOM node, isn't it? This node should be altered. For textboxes this is not a problem, and I thought it might be as easy in the case of dropdown lists - but it isn't.&lt;br /&gt;&lt;br /&gt;For textboxes one simply writes:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;XPathNavigator root = this.MainDataSource.CreateNavigator();&lt;br /&gt;XPathNavigator name = root.SelectSingleNode("//my:name", this.NamespaceManager);&lt;br /&gt;name.SetValue("XXXXXXXXXXXXXXX");&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;and I thought there's a similiar way to alter DDLs?&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;Set up your drop-down list to populate based on your MOSS list. Then when list is updated, your drop-down choices will automatically be updated.&lt;hr height="1" noshade id="quote"&gt;&lt;/font id="quote"&gt;&lt;/blockquote id="quote"&gt;&lt;br /&gt;&lt;br /&gt;This is not possible because I don't want the content of the list in my DDL. I just want to have a DDL with the &lt;i&gt;names of the columns&lt;/i&gt; of a MOSS list.&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;If this is not possible, create a secondary data source and point your drop-down list at that. Then use code to add or remove nodes from that data source. The repeating list of nodes will be the options your drop-down list displays.&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;I can't create a data source that points to nothing. IP wants always a distinct target. Should I choose something arbitrary and modify the .xsd file later? Are resource files in this context a possible way?</description></item><item><title>Re: C# should fill IP DropDownList</title><link>https://www.infopathdev.com:443/forums/thread/11991.aspx</link><pubDate>Wed, 06 Dec 2006 22:33:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:11991</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/11991.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=11991</wfw:commentRss><description>You don't alter any "control" in InfoPath -- only DOM nodes.&lt;br /&gt;&lt;br /&gt;Set up your drop-down list to populate based on your MOSS list. Then when list is updated, your drop-down choices will automatically be updated.&lt;br /&gt;&lt;br /&gt;If this is not possible, create a secondary data source and point your drop-down list at that. Then use code to add or remove nodes from that data source. The repeating list of nodes will be the options your drop-down list displays.</description></item><item><title>C# should fill IP DropDownList</title><link>https://www.infopathdev.com:443/forums/thread/11745.aspx</link><pubDate>Wed, 06 Dec 2006 17:26:56 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:11745</guid><dc:creator>Kun</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/11745.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=43&amp;PostID=11745</wfw:commentRss><description>I'm using InfoPath 2007 and MOSS 2007 Forms Server. I've one combo box that should be filled with the column names (NOT values in this column) of another MOSS' list. &lt;br /&gt;&lt;br /&gt;Unfortunately I haven't found any way in IP to do this. Is there a way?&lt;br /&gt;&lt;br /&gt;That's why I want to do this with C# using the SP object model. It's easy to alter simple text boxes but a DropDownList seems to be more complex as the displayed and selected values are not stored in one place!?&lt;br /&gt;&lt;br /&gt;I've tried something like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;XPathNavigator root = this.MainDataSource.CreateNavigator();&lt;br /&gt;XPathNavigator ddl = root.SelectSingleNode("//my:dropdownlist", this.NamespaceManager);&lt;br /&gt;ddl.SetValue("first value");&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;But this doesn't work!&lt;br /&gt;&lt;br /&gt;Thanks in further for any help!</description></item></channel></rss>