Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 742859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T08:47:45+00:00 2026-05-14T08:47:45+00:00

I recently upgraded my Silverlight app from 3 to 4. After a few hours

  • 0

I recently upgraded my Silverlight app from 3 to 4. After a few hours of bashing my head against the wall, trying to resolve an issue, I’ve narrowed down the problem to this:

I have a user control, with a ComboBox inside it. The ComboBox has a single ComboBoxItem child. The user control exposes a get accessors that returns the ComboBox’s Items object, allowing me to add additional ComboBoxItems via xaml.

This all worked fine in Silverlight 3, however it’s not working in Silverlight 4.

As code:

//XAML
<UserControl ... >
  <ComboBox Name="myComboBox">
    <ComboBoxItem Content="Select an Item" />
  </ComboBox>
  <!-- All my other stuff -->
</UserControl>

//Code behind
public ItemCollection ListItems
{
   get
   {
     return myComboBox.Items;
   }
}

//Implementation of User-Control
<CustomControl:UserControl ... >
  <CustomControl:UserControl.ListItems>
    <ComboBoxItem Content="Item 1" />
    <ComboBoxItem Content="Item 2" />
    <ComboBoxItem Content="Item 3" />
  </CustomControl:UserControl.ListItems>
</CustomControl:UserControl>

As I mentioned, this all worked fine in Silverlight 3, but doesn’t work in Silverlight 4.

The workaround, it seems, is to remove that single ComboBoxItem that’s inside my user-control, but I’m hoping to avoid, as I want it as the default item.

Any help would be much appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T08:47:46+00:00Added an answer on May 14, 2026 at 8:47 am

    The XAML parser was re-written for Silverlight 4 to make it more consistent with WPF. I am pretty certain the behavior you are expecting was a bug in SL3 and I don’t think it would have worked that way in WPF though I’ve never actually tried.

    You may be able to get the old mode back by enabling quirks mode but I wouldn’t recommend it. Instead, what I would do is create a ControlTemplate for the combo box to display the “select an item” text when there is nothing selected. Having that be an actual item in the combo box really just a hack that we’ve always been forced to do with technologies such as Windows Forms and HTML but in Silverlight it seems like having SelectedItem be null is more appropriate.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently upgraded my SVN client from 1.6.9 to 1.7.2 and after converting to
I recently upgraded Xcode from 3.2 to 4.2. After the upgrade I was having
We recently upgraded our rails app from version 3.0.3 to 3.1.0. The application runs
I recently upgraded to xCode 3.2.5 and iOS 4.2 . After this, the app
I recently upgraded my magento from 1.4 to 1.6.1 after fixing lots of bugs
I recently upgraded to SilverLight 3 (beta) and for some reason the SilverLight plug
I recently upgraded to Lion and I am trying to install Rails. I used
I recently 'upgraded' my app to the cedar platform on Heroku. By default, I
I recently upgraded from jQuery 1.2.6 to 1.3.2 Now on the page I'm using
I recently upgraded my machine from Leopard to Snow Leopard. Also I installed the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.