I read the previous post on this problem. In certain situations I am still having trouble selecting the first element in the combo box.
RadComboBox version 2008.3.1117.1020
I have a data template with two columns.
I have tried FilteringMode = StartsWith or Contains.
If I type in a value that is not in the drop down then I display a message and clear the combo text. Then if I try to select the first item it won't select. The second item will. After selecting the second item then I can select the first item.
<DataTemplate x:Key="test_getFEFPCodesResultTemplate">
<Grid Margin="0,0,0,0" Width="150">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40"/>
<ColumnDefinition Width="100"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Text="{Binding Path=Code}" />
<TextBlock Grid.Row="0" Grid.Column="1" Foreground="Blue" Text="{Binding Path=Description}" />
</Grid>
</DataTemplate>
<telerikInput:RadComboBox ItemsSource="{Binding Mode=OneWay}" IsEditable="True" telerik:TextSearch.TextPath="Code" Height="20" MinHeight="20" Width="52" FontSize="10" IsEnabled="True" Background="#FF000000" x:Name="cmbFEFP" ItemTemplate="{StaticResource test_getFEFPCodesResultTemplate}" SelectedIndex="-1" Canvas.Left="6.739" Canvas.Top="118" IsReadOnly="False" FilteringMode="Contains">
<telerikInput:RadComboBox.DataContext>
<CatalogDemo_ServiceReference1:test_getCatalogFEFPCodesResult/>
</telerikInput:RadComboBox.DataContext>
Here is the data validation code in the lost focus event. If you know of an easier way to do the validation then please point me in the right direction.
Thanks
RadComboBox version 2008.3.1117.1020
I have a data template with two columns.
I have tried FilteringMode = StartsWith or Contains.
If I type in a value that is not in the drop down then I display a message and clear the combo text. Then if I try to select the first item it won't select. The second item will. After selecting the second item then I can select the first item.
<DataTemplate x:Key="test_getFEFPCodesResultTemplate">
<Grid Margin="0,0,0,0" Width="150">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40"/>
<ColumnDefinition Width="100"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Text="{Binding Path=Code}" />
<TextBlock Grid.Row="0" Grid.Column="1" Foreground="Blue" Text="{Binding Path=Description}" />
</Grid>
</DataTemplate>
<telerikInput:RadComboBox ItemsSource="{Binding Mode=OneWay}" IsEditable="True" telerik:TextSearch.TextPath="Code" Height="20" MinHeight="20" Width="52" FontSize="10" IsEnabled="True" Background="#FF000000" x:Name="cmbFEFP" ItemTemplate="{StaticResource test_getFEFPCodesResultTemplate}" SelectedIndex="-1" Canvas.Left="6.739" Canvas.Top="118" IsReadOnly="False" FilteringMode="Contains">
<telerikInput:RadComboBox.DataContext>
<CatalogDemo_ServiceReference1:test_getCatalogFEFPCodesResult/>
</telerikInput:RadComboBox.DataContext>
Here is the data validation code in the lost focus event. If you know of an easier way to do the validation then please point me in the right direction.
Private Sub cmbFEFP_LostFocus(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles cmbFEFP.LostFocus
If cmbFEFP.Text = "" Then
cmbFEFP.SelectedIndex = -1
Exit Sub
End If
Dim found As Boolean = False
Dim fefpCode As ServiceReference1.test_getCatalogFEFPCodesResult
For index = 0 To cmbFEFP.Items.Count - 1
fefpCode = cmbFEFP.Items(index)
If fefpCode.Code = cmbFEFP.Text Then
found =
True
Exit For
End If
Next
If Not found Then
RadWindow.Alert(
"This item not in list.")
cmbFEFP.SelectedIndex = -1
cmbFEFP.Text =
""
End If
End Sub
Thanks