<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.silverlight.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>Silverlight Controls and Silverlight Toolkit</title><link>http://forums.silverlight.net/forums/35.aspx</link><description>Discussions around using and developing Silverlight controls and the Silverlight Toolkit</description><dc:language>en</dc:language><generator>CommunityServer 2007 (Build: 20416.853)</generator><item><title>Re: Re: ComboBox SelectedItem not visible when dropdown activated</title><link>http://forums.silverlight.net/forums/thread/240872.aspx</link><pubDate>Thu, 02 Jul 2009 15:53:26 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:240872</guid><dc:creator>lingbing</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/240872.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=240872</wfw:commentRss><description>&lt;p&gt;Hi, duke, the silverlight page doesn&amp;#39;t has an init event, however, it has an Loaded event, you can initialize/populate your ComboBox at the Loaded handler.&lt;/p&gt;
&lt;p&gt;The Dispatcher.BeginInvoke(Action a) make that action be called when UI thread is idle, if you call MyComboBox.IsDropDownOpen=true at once after you set ItemsSource for that ComboBox, nothing will happen, and the inner Dispatcher.BeginInvoke uses as the same function.&lt;/p&gt;
&lt;p&gt;Sorry for my poor English, wish my explaination is clear. Regards!&lt;/p&gt;</description></item><item><title>Re: Re: ComboBox SelectedItem not visible when dropdown activated</title><link>http://forums.silverlight.net/forums/thread/240848.aspx</link><pubDate>Thu, 02 Jul 2009 15:06:12 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:240848</guid><dc:creator>DukeAmes</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/240848.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=240848</wfw:commentRss><description>&lt;p&gt;Thanks for the reply Reeta,&lt;/p&gt;
&lt;p&gt;I like the look of&amp;nbsp;your solution, however&amp;nbsp;I have no idea how to implement it.&lt;/p&gt;
&lt;p&gt;Would you mind being more specific with your example? I have a Silverlight xaml page with a &amp;lt;Combobox x:Name=&amp;quot;MyComboBox&amp;quot; /&amp;gt; and a xaml.cs code page.&lt;/p&gt;
&lt;p&gt;Appreciate your help!&lt;/p&gt;
&lt;p&gt;-Duke&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Re: ComboBox SelectedItem not visible when dropdown activated</title><link>http://forums.silverlight.net/forums/thread/240846.aspx</link><pubDate>Thu, 02 Jul 2009 15:01:36 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:240846</guid><dc:creator>DukeAmes</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/240846.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=240846</wfw:commentRss><description>&lt;p&gt;Thanks very much for your answer Ling; worked very well &lt;img src="http://silverlight.net/emoticons/emotion-1.gif" alt="Smile" /&gt;&lt;/p&gt;
&lt;p&gt;That being said I&amp;#39;m new to Silverlight,&amp;nbsp;and was a bit confused with your code,&amp;nbsp;looking for an Init event. I changed your code to make it&amp;nbsp;more clear:&lt;/p&gt;
&lt;p&gt;&amp;lt;ComboBox x:Name=&amp;quot;MyComboBox&amp;quot;/&amp;gt;&lt;br /&gt;in xaml.cs:&lt;br /&gt;private void PopulateMyComboBox()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyComboBox.ItemSource=xxxxx;// Anything you want&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dispatcher.BeginInvoke(delegate&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyComboBox.IsDropDownOpen=true;//open the dropdown&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dispatcher.BeginInvoke(delegate&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;MyComboBox.SelectedIndex=xxxx;// Any index you want&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Or MyComboBox.SelectedItem=xxxx; Any object you want&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyComboBox.IsDropDownOpen=false;// Close the dropdown&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;});&lt;br /&gt;}&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks again,&lt;/p&gt;
&lt;p&gt;-Duke&lt;/p&gt;</description></item><item><title>Re: ComboBox SelectedItem not visible when dropdown activated</title><link>http://forums.silverlight.net/forums/thread/240688.aspx</link><pubDate>Thu, 02 Jul 2009 09:25:55 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:240688</guid><dc:creator>Reeta Lodhi</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/240688.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=240688</wfw:commentRss><description>&lt;p&gt;Try to&amp;nbsp;set the SelectedIndex on page loaded event.&lt;/p&gt;
&lt;p&gt;void Window1_Loaded(object sender, RoutedEventArgs e)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;myComboBox.SelectedIndex=0;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;</description></item><item><title>Re: ComboBox SelectedItem not visible when dropdown activated</title><link>http://forums.silverlight.net/forums/thread/240546.aspx</link><pubDate>Thu, 02 Jul 2009 03:10:02 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:240546</guid><dc:creator>lingbing</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/240546.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=240546</wfw:commentRss><description>&lt;p&gt;Hi, it is a pity that ComBoBox doesn&amp;#39;t has ScrollToView method as ListBox, when you set SelectedItem or SelectedIndex, if the Dropdown is not open, it will just change the ToggleButton&amp;#39;s content. However, if the Dropdown is open, the selected ComboxItem will get focus, then it is scrolled to view itself.&lt;/p&gt;
&lt;p&gt;So there is a workaround, you can use Dispatcher.BeginInvoke, it will like:&lt;br /&gt;In xaml:&lt;br /&gt;&amp;lt;ComBoBox x:Name=&amp;quot;Box&amp;quot;/&amp;gt;&lt;br /&gt;in xaml.cs:&lt;br /&gt;private void InitComBoBox()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Box.ItemSource=xxxxx;// Anything you want&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dispatcher.BeginInvoke(delegate&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Box.IsDropDownOpen=true;//open the dropdown&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dispatcher.BeginInvoke(delegate&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Box.SelectedIndex=xxxx;// Any index you want&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Or Box.SelectedItem=xxxx; Any object you want&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Box.IsDropDownOpen=false;// Close the dropdown&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;});&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;Because you open the dropdown the index you selected will get focus and scroll to view, and then you close it, user will not see the dropdown, everything is ok, this trick will not be found by end user.&lt;/p&gt;
&lt;p&gt;Regards!&lt;/p&gt;</description></item><item><title>ComboBox SelectedItem not visible when dropdown activated</title><link>http://forums.silverlight.net/forums/thread/240516.aspx</link><pubDate>Thu, 02 Jul 2009 01:37:09 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:240516</guid><dc:creator>DukeAmes</dc:creator><slash:comments>0</slash:comments><comments>http://forums.silverlight.net/forums/thread/240516.aspx</comments><wfw:commentRss>http://forums.silverlight.net/forums/commentrss.aspx?SectionID=35&amp;PostID=240516</wfw:commentRss><description>&lt;p&gt;If I set the SelectedItem or Index when the I initialize the page, the item is not visible in the dropdown list. The user has to scroll to see it.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What is the fix for this?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;-Duke&lt;/p&gt;</description></item></channel></rss>