Silverlight Controls and Silverlight Toolkithttp://forums.silverlight.net//35.aspx/1?Silverlight+Controls+and+Silverlight+ToolkitDiscussions around using and developing Silverlight controls and the Silverlight ToolkitMon, 01 Jan 0001 00:00:00 -050035224602http://forums.silverlight.net//p/98287/224602.aspx/1?Combobox+set+valueCombobox set value <p>&nbsp;How can I set a default value for the combobox to display? My combobox is filled with data from a list and I need it to display one of the values from that list. I have a product and the its category is displayed in that combobox and I need that when I see the product details the category combobox value be set to the specific product category. I have tried using something like combo1.SelectedItem = &quot;aaaa&quot; but it doesn't work. <br> </p> <p>Help? <br> </p> 2009-05-26T13:23:26-04:00224639http://forums.silverlight.net//p/98287/224639.aspx/1?Re+Combobox+set+valueRe: Combobox set value <p>Have you set the DisplayMemberPath, if not then set it or else post your code.</p> 2009-05-26T14:08:56-04:00224685http://forums.silverlight.net//p/98287/224685.aspx/1?Re+Combobox+set+valueRe: Combobox set value <p>Well, I will try to explain the details of what I want to do and how I need to set that value for the combobox. </p> <p>I have a Silverlight page that shows a datagrid of products and when I select one of the product another page Silverlight is opened&nbsp; and I am supposed to see the selected product details. I am sending the product id as a parameter to the new page and I get all the information needed but for the Category combobox I don't want to get only the whole list of existing categories but when the page is loaded with all the data I want to see the value I choose for the combobox and not as unselected.<br> </p> <p>I have not used any DisplayMemberPath. I don't think it applies in my case. Specific code that could help I don't have. I just retrive the data needed from a wcf service using the product id and display all in textboxes and comboboxes. <br> </p> <p>&nbsp;</p> 2009-05-26T15:28:30-04:00225036http://forums.silverlight.net//p/98287/225036.aspx/1?Re+Combobox+set+valueRe: Combobox set value <p>You can first fill the combo and then set product i to it like this:</p> <font size="2"> <p>ddlProduct.SelectedIndex = productid;</p> <p>or check this <a href="http://silverlight.net/forums/t/67956.aspx">http://silverlight.net/forums/t/67956.aspx</a></p> <p>Hope it helps you.</p> </font> 2009-05-27T08:34:52-04:00225052http://forums.silverlight.net//p/98287/225052.aspx/1?Re+Combobox+set+valueRe: Combobox set value <p>&nbsp;Thank you! The index setting worked perfectly! <br> </p> 2009-05-27T09:04:28-04:00