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 6548577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:59:14+00:00 2026-05-25T11:59:14+00:00

I have a ComboBox in Silverlight that has very inconsistent behavior. I have the

  • 0

I have a ComboBox in Silverlight that has very inconsistent behavior.

I have the ComboBox bound to a dynamic collection of data where elements are added or removed. Here is the XAML for the ComboBox:

<ComboBox Margin="0,-1,0,0" Width="20" Grid.Row="0" Grid.Column="0" ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ItemsContained}" x:Name="TabComboBox" >
    <ComboBox.ItemsPanel>
        <ItemsPanelTemplate>
            <StackPanel Background="White" MinWidth="250" />
        </ItemsPanelTemplate>
    </ComboBox.ItemsPanel>
</ComboBox>

So this works great and the ComboBox opens “up” with the long list of items in ItemsContained. However, if I delete one of the items in ItemsContained, the ComboBox all of a sudden will switch from opening “up” to opening “down” when you click on it, despite the fact there are a lot of items in this collection and there is only 20 or so pixels of room for it to open down. I cannot figure this out. I have even tried setting the ItemsPanelTemplate to have a MinHeight, but that does not help. Does anyone know how to make the ComboBox always open “up”?

Also, even if I set the MinHeight to something ridiculous, such as 10,000, it still does this.

EDIT: As an update, I have gotten this to work by creating a whole new ComboBox every time ItemsContained is changed. This is the code:

scrollingGrid.Children.Remove(tabComboBox);
tabComboBox.ItemsSource = null;
ComboBox boxy = new ComboBox()
{
    ItemsSource = ItemsContained
};
scrollingGrid.Children.Add(boxy);
tabComboBox = boxy;

I feel this is a little ad hoc, so if anyone has a better idea, let me know. Changing the height of the ScrollViewer inside the ComboBox does not work either.

  • 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-25T11:59:15+00:00Added an answer on May 25, 2026 at 11:59 am

    I think this is a Silverlight Bug. When you set the ItemsSource property the behavior of the combobox popup changes from up to down.

    I Clone my combobox in the event DropDownClosed of each combobox and that works for me.

     Private Sub cbRow1_DropDownClosed(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbRow1.DropDownClosed, cbRow2.DropDownClosed, cbRow3.DropDownClosed, cbRow4.DropDownClosed, cbRow5.DropDownClosed
        Dim co As ComboBox = CType(sender, ComboBox)
        CloneComboBox(co)
    End Sub
    
    Private Sub CloneComboBox(ByVal co As ComboBox)
        Dim cbClon = New ComboBox()
        cbClon.Margin = co.Margin
        cbClon.Width = co.Width
        cbClon.Height = co.Height
        cbClon.Name = co.Name
        cbClon.Tag = co.Tag
    
        cbClon.ItemsSource = co.ItemsSource
        cbClon.SelectedIndex = co.SelectedIndex
    
        LayoutRoot.Children.Remove(co)
        LayoutRoot.Children.Add(cbClon)
    
        //this is because I have my comboboxes inside a grid
        System.Windows.Controls.Grid.SetRow(cbClon, cbClon.Tag)
        System.Windows.Controls.Grid.SetColumn(cbClon, 0)
    
    
        AddHandler cbClon.DropDownClosed, AddressOf cbRow1_DropDownClosed
    
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ComboBox that has the SelectedItem bound to the ViewModel. <ComboBox SelectedItem={Binding
I have a combobox that has the entries of a full name, eg: John
I have a Silverlight application with a ComboBox that is filled by VideoCaptureDevice 's.
I Have a Silverlight WPF app that shows tabs of data in this case
I have a combo box in Silverlight. It has a collection of values built
I'm using a Silverlight 4.0 project that utilizes MVVM and we have a combobox
I have a combobox that passes along values in text, but they can have
I have a ComboBox that I am populating with a list of parts for
I have a combobox that I have Enabled = false. When that is the
I have a combobox in a view that receives information about application state changes,

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.