This is a migrated thread and some comments may be shown as answers.

Don't select the value of SelectedItem of the RadComboBox to RadComboBox.Text.

0 Answers 41 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
yang
Top achievements
Rank 1
yang asked on 15 Dec 2010, 10:18 AM
Don't select the value of SelectedItem of the RadComboBox to RadComboBox.Text.
RadComboBox is data bound to a collection of custom objects.
The code is :
The XAML.cs:
WCFBusiServiceClient wcfBusiServiceClient = new WCFBusiServiceClient();
wcfBusiServiceClient.GetSchemeDataCompleted += new EventHandler<GetSchemeDataCompletedEventArgs>(wcfBusiServiceClient_GetSchemeDataCompleted);
            wcfBusiServiceClient.GetSchemeDataAsync();
  
void wcfBusiServiceClient_GetSchemeDataCompleted(object sender, GetSchemeDataCompletedEventArgs e)
        {
            try
            {
                this.cmBoxScheme.ItemsSource = e.Result;
            }
            catch
            {
                throw new NotImplementedException();
            }
        }
  
  
The XAML:
  
<DataTemplate x:Key="SchemeItemTemplate">
            <StackPanel Orientation="Horizontal">
                <TextBlock  Name="txtSchemeItem" Text="{Binding SchemeName}"/>
            </StackPanel>
        </DataTemplate>
  
  
<telerik:RadComboBox Grid.Row="0" Grid.Column="2" Width="83" Height="25" Margin="0,0,0,5" Name="cmBoxScheme" VerticalAlignment="Center" HorizontalAlignment="Left" 
                                     IsEditable="True" IsDropDownOpen="True" TextSearchMode="StartsWith" IsFilteringEnabled="True"
                                     ClearSelectionButtonVisibility="Visible" ClearSelectionButtonContent="??????"
                                     IsMouseWheelEnabled="True" SelectedItem="SchemeName"
                                     ItemTemplate="{StaticResource SchemeItemTemplate}" SelectionChanged="cmBoxScheme_SelectionChanged" />



No answers yet. Maybe you can help?

Tags
ComboBox
Asked by
yang
Top achievements
Rank 1
Share this question
or