<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/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>Data Access and ObjectDataSource Control</title><link>http://forums.asp.net/23.aspx</link><description>Questions and discussions related to using ADO.NET for data access, and the ObjectDataSource control. &lt;a href="http://aspadvice.com/SignUp/list.aspx?l=9&amp;c=17" target="_blank"&gt;Email List&lt;/a&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: DropDownList based on data Control inside another Control</title><link>http://forums.asp.net/thread/1478556.aspx</link><pubDate>Tue, 28 Nov 2006 07:36:45 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1478556</guid><dc:creator>emmav</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1478556.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=23&amp;PostID=1478556</wfw:commentRss><description>What I couldn't do with FindControl I could do with this function: &lt;br /&gt;
&lt;pre class="coloredcode"&gt;&lt;b id="1"&gt;1    &lt;/b&gt;  &lt;span class="kwd"&gt;protected static&lt;/span&gt; Control FindControlRecursive(&lt;span class="kwd"&gt;string&lt;/span&gt; Id, Control Root)&lt;br /&gt;&lt;b id="2"&gt;2    &lt;/b&gt;  {&lt;br /&gt;&lt;b id="3"&gt;3    &lt;/b&gt;    &lt;span class="kwd"&gt;if&lt;/span&gt; (Root.ID == Id)&lt;br /&gt;&lt;b id="4"&gt;4    &lt;/b&gt;      &lt;span class="kwd"&gt;return&lt;/span&gt; Root;&lt;br /&gt;&lt;b id="5"&gt;5    &lt;/b&gt;
&lt;b id="6"&gt;6    &lt;/b&gt;    &lt;span class="kwd"&gt;foreach&lt;/span&gt; (Control Ctl &lt;span class="kwd"&gt;in&lt;/span&gt; Root.Controls)&lt;br /&gt;&lt;b id="7"&gt;7    &lt;/b&gt;    {&lt;br /&gt;&lt;b id="8"&gt;8    &lt;/b&gt;      Control FoundCtl = FindControlRecursive(Id, Ctl);&lt;br /&gt;&lt;b id="9"&gt;9    &lt;/b&gt;      &lt;span class="kwd"&gt;if&lt;/span&gt; (FoundCtl != &lt;span class="kwd"&gt;null&lt;/span&gt;)&lt;br /&gt;&lt;b id="10"&gt;10   &lt;/b&gt;        &lt;span class="kwd"&gt;return&lt;/span&gt; FoundCtl;&lt;br /&gt;&lt;b id="11"&gt;11   &lt;/b&gt;    }&lt;br /&gt;&lt;b id="12"&gt;12   &lt;/b&gt;    &lt;span class="kwd"&gt;return null&lt;/span&gt;;&lt;br /&gt;&lt;b id="13"&gt;13   &lt;/b&gt;  }&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;(lifted from &lt;a href="http://www.west-wind.com/WebLog/posts/5127.aspx"&gt;http://www.west-wind.com/WebLog/posts/5127.aspx&lt;/a&gt;) and using &amp;nbsp;&lt;/p&gt;
&lt;pre class="coloredcode"&gt;&lt;b id="1"&gt;1    &lt;/b&gt;DropDownList Customer = FindControlRecursive(&lt;span class="st"&gt;"KundeDropList"&lt;/span&gt;, FormView1) &lt;span class="kwd"&gt;as&lt;/span&gt; DropDownList;&lt;/pre&gt;
&lt;pre class="coloredcode"&gt;And setting selectedvalue manually.&lt;/pre&gt;&lt;pre class="coloredcode"&gt;Thanks for your help &lt;span class="inlineLink"&gt;cwlaualex! (That's quite a nick, does it mean anything? Different language?)&lt;/span&gt;&lt;/pre&gt;&amp;nbsp;&lt;br /&gt;</description></item><item><title>Re: DropDownList based on data Control inside another Control</title><link>http://forums.asp.net/thread/1478305.aspx</link><pubDate>Tue, 28 Nov 2006 02:33:23 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1478305</guid><dc:creator>cwlaualex</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1478305.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=23&amp;PostID=1478305</wfw:commentRss><description>&lt;p&gt;Maybe you need to post some of your code here. The FindControl function should return the required DropDownList.&lt;/p&gt;</description></item><item><title>Re: DropDownList based on data Control inside another Control</title><link>http://forums.asp.net/thread/1477299.aspx</link><pubDate>Mon, 27 Nov 2006 07:53:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1477299</guid><dc:creator>emmav</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1477299.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=23&amp;PostID=1477299</wfw:commentRss><description>&lt;p&gt;By doing it programatically rather than using the designer? &lt;/p&gt;&lt;p&gt;I tried using FindControl as in:&amp;nbsp;&lt;/p&gt;&lt;pre class="coloredcode"&gt;DropDownList Customer = (DropDownList) FormView1.FindControl(&lt;span class="st"&gt;"KundeDropList"&lt;/span&gt;);&lt;/pre&gt;&amp;nbsp; But it won't have any of it, saying "Object reference not set to an instance of an object."&lt;br /&gt;</description></item><item><title>Re: DropDownList based on data Control inside another Control</title><link>http://forums.asp.net/thread/1475938.aspx</link><pubDate>Sat, 25 Nov 2006 02:11:59 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1475938</guid><dc:creator>cwlaualex</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1475938.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=23&amp;PostID=1475938</wfw:commentRss><description>Do you use FormViewName.FindControl to locate your second DDL? You need to use FindControl for every controls inside the FormView.&lt;br /&gt;</description></item><item><title>DropDownList based on data Control inside another Control</title><link>http://forums.asp.net/thread/1475555.aspx</link><pubDate>Fri, 24 Nov 2006 14:45:15 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1475555</guid><dc:creator>emmav</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1475555.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=23&amp;PostID=1475555</wfw:commentRss><description>&lt;p&gt;Ok, so I have a FormView with a Customer dropdown, and a Location dropdown. The Location dropdown is dependant on the Customer dropdown.&lt;br /&gt;&lt;br /&gt;"Easy," I think. But no. The Location drop down works when it and the Customer dropdown is placed outside the Formview. But when they are both inside the formview they don't as they aren't in the right scope(or whatever). I've tried CustomerDropDown, but to no avail.&lt;br /&gt;&lt;br /&gt;Anyone have any ideas on how to manage this? &lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>