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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:38:32+00:00 2026-06-08T02:38:32+00:00

I have two silverlight listpicker controls in my windows phone 7. Here is my

  • 0

I have two silverlight listpicker controls in my windows phone 7.

Here is my XAML for that.

// First listpicker for country names

    <toolkit:ListPicker x:Name="listPickerCountryLogin" SelectionChanged="listPickerCountryLogin_SelectionChanged" Height="72" HorizontalAlignment="Left" Margin="14,43,0,0" VerticalAlignment="Top" Width="436" FullModeHeader="Select Country" Background="White" BorderBrush="White" Foreground="{StaticResource listPickerBrush}">
                            <toolkit:ListPicker.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="{Binding Country}" Width="250" />
                                    </StackPanel>
                                </DataTemplate>
                            </toolkit:ListPicker.ItemTemplate>
                            <toolkit:ListPicker.FullModeItemTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="{Binding Country}" Width="300" Margin="0,0,0,20" FontSize="24"/>
                                    </StackPanel>
                                </DataTemplate>
                            </toolkit:ListPicker.FullModeItemTemplate>
                        </toolkit:ListPicker>

// and here is my second listpciker for country codes

                    <toolkit:ListPicker x:Name="listPickerCCLogin" SelectionChanged="listPickerCCLogin_SelectionChanged" Height="56.3" Width="80" HorizontalAlignment="Left" Margin="14,100,0,0"  VerticalAlignment="Top" FullModeHeader="Select Country" Background="White" BorderBrush="White" Foreground="{StaticResource listPickerBrush}">
                        <toolkit:ListPicker.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Name="lblCC" Text="{Binding CC}" Width="235" />
                                </StackPanel>
                            </DataTemplate>
                        </toolkit:ListPicker.ItemTemplate>
                        <toolkit:ListPicker.FullModeItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock  Text="{Binding Country}" Width="300" Margin="0,0,0,20" FontSize="24"/>
                                </StackPanel>
                            </DataTemplate>
                        </toolkit:ListPicker.FullModeItemTemplate>
                    </toolkit:ListPicker>

Now Scenario is if user selects the country name then it will automatically set country code of that country as well and vice versa.

for this thing I am using listpicker selection change events for both lists.

Here is my C# code.

First I am binding my listpickers with collection of countries in this method.

/// <summary>
        /// Binding All Listpickers With Data
        /// </summary>
        protected void BindListPickers()
        {
            CountryListParser oCountryList = new CountryListParser();
            this.listPickerCountryLogin.ItemsSource = oCountryList.GetAllCountries();
            this.listPickerCCLogin.ItemsSource = oCountryList.GetAllCountries();
        }

And here is list picker selection change events.

  /// <summary>
        /// Country List Picker Of Login Selection Change Event
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void listPickerCountryLogin_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (listPickerCountryLogin.SelectedIndex >= 0 && listPickerCountryLogin.SelectedIndex < listPickerCCLogin.Items.Count)
                listPickerCCLogin.SelectedIndex = listPickerCountryLogin.SelectedIndex;
        }

/// <summary>
/// Country Code List Picker Of Login Selection Change Event
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void listPickerCCLogin_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
    if (listPickerCCLogin.SelectedIndex >= 0 && listPickerCCLogin.SelectedIndex < listPickerCountryLogin.Items.Count)
        listPickerCountryLogin.SelectedIndex = listPickerCCLogin.SelectedIndex;
}

Still up my code works fine without any error. Now come the tricky and difficult part where I am stucked. I am calling one Google service and passes the lat long of user and it returns me user country and I want set that country to my list pickers.

Here is My Code

protected void OnLocationServiceResponseRecieved(string response)
        {
            JObject o = JObject.Parse(response);
            string Country = (string)o["countryname"];

            Dispatcher.BeginInvoke(new System.Action(delegate()
            {
                CountryListParser oCountryList = new CountryListParser();
                int countrytIndex = oCountryList.CountryIndexByName(Country);
                this.listPickerCountryLogin.SelectedIndex = countrytIndex;
                this.listPickerCCLogin.SelectedIndex = countrytIndex;
            }));
        }

still there no exceptions come and everything goes well and it sets my listpicker selected index as per my country but it not updates the UI of my listpicker and do them blank or you can say empty. But as I tap on my listpicker in backend my desired country is already set. But not updated or stucked in UI thread.

So problem is UI is not updated properly

=== UPDATE ===

My Sample Code Where Issue Is Reproducing

My finding is in my attached project in selected index method when index is above 38. It will goes blank. I dont know why its behaving like this way..

  • 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-06-08T02:38:34+00:00Added an answer on June 8, 2026 at 2:38 am

    I have fixed that issue after 3 days struggle. Earlier I was thinking it was Problem in My UI thread and its not got refreshing. And I focused on that part as I was assuming thats the Issues. But in 3rd Day I noticed that might be this can be wrong in listpicker control. And I studied on codeplex. Some people also facing this problem. But How I Rectified let me tell you. I did four steps

    1. I removed all the reference of silverlight toolkit from my project and cleaned the solution.

    2. I installed the silverlight toolkit from pc and then installed the Nov-2011 stable version and restarted PC and referred the dll in my project from this new installation.

    3. I binded selected index as well with my listpicker control.

                  <toolkit:ListPicker x:Name="listPickerCountryLogin" SelectionChanged="listPickerCountryLogin_SelectionChanged" Height="72" HorizontalAlignment="Left" Margin="14,43,0,0" VerticalAlignment="Top" Width="436" FullModeHeader="Select Country" Background="White" BorderBrush="White" Foreground="{StaticResource listPickerBrush}">
                      <toolkit:ListPicker.Resources>
                          <Style TargetType="toolkit:ListPickerItem">
                              <Setter Property="Padding" Value="8 6"/>
                          </Style>
                      </toolkit:ListPicker.Resources>
                      <toolkit:ListPicker.Style>
                          <StaticResource ResourceKey="ListPickerStyle"/>
                      </toolkit:ListPicker.Style>
                      <toolkit:ListPicker.ItemTemplate>
                          <DataTemplate>
                              <StackPanel Orientation="Horizontal">
                                  <TextBlock Text="{Binding Country}" Width="250" />
                              </StackPanel>
                          </DataTemplate>
                      </toolkit:ListPicker.ItemTemplate>
                      <toolkit:ListPicker.FullModeItemTemplate>
                          <DataTemplate>
                              <StackPanel Orientation="Horizontal">
                                  <TextBlock Text="{Binding Country}" Width="300" Margin="0,0,0,20" FontSize="24"/>
                              </StackPanel>
                          </DataTemplate>
                      </toolkit:ListPicker.FullModeItemTemplate>
                  </toolkit:ListPicker>
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have two silverlight user controls name region.xaml and session.xaml and i want to
I want to have two separate interfaces to my website, one that is silverlight,
I have two silverlight (2 or 3) datagrids (from the July 2009 Silverlight toolkit)
In my silverlight application I have two wcf services, that used to be one,
I have a function in my silverlight app, that takes one or two seconds
Is it possible to have two controls on one page side-by-side in Silverlight? It
First, I have two project working on: ASP.NET and Silverlight Both uses a class
I have two controls. The XAML's are big and very similar. One difference is
I've got two Silverlight Controls in my project, both have properties TeamId. I would
I have two silverlight applications. I want to reference the first one from 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.