This question is locked. New answers and comments are not allowed.
Hi,
I would like to change AutoCompleteBox's itemssource when users selecting a specific value in a ComboBox
I have tried like this:
Private Async Sub RicercaField_Cmb_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles RicercaField_Cmb.SelectionChanged
Dim sqlquery As String
Select RicercaField_Cmb.SelectedIndex
Case 2
'Me.RicercaTxt_Txt = New Telerik.UI.Xaml.Controls.Input.RadAutoCompleteBox
sqlquery = "SELECT Descrizione From Famiglia"
Dim db As New SQLite.SQLiteAsyncConnection(dbpath)
Me.RicercaTxt_Txt.ItemsSource = Nothing
Me.RicercaTxt_Txt.DisplayMemberPath = "Descrizione"
Me.RicercaTxt_Txt.FilterMode = Telerik.UI.Xaml.Controls.Input.AutoCompleteBoxFilterMode.Contains
Me.RicercaTxt_Txt.ItemsSource = Await db.QueryAsync(Of Famiglia)(sqlquery)
Case 3
sqlquery = "SELECT DISTINCT Marchio From Articolo"
Dim db As New SQLite.SQLiteAsyncConnection(dbpath)
Me.RicercaTxt_Txt.DisplayMemberPath = "Marchio"
Me.RicercaTxt_Txt.FilterMode = Telerik.UI.Xaml.Controls.Input.AutoCompleteBoxFilterMode.Contains
Me.RicercaTxt_Txt.ItemsSource = Nothing
Me.RicercaTxt_Txt.ItemsSource = Await db.QueryAsync(Of Articolo)(sqlquery)
Case Else
Me.RicercaTxt_Txt.ItemsSource = Nothing
End Select
End Sub
(RicercaTxt_Txt is my autocompletebox)
When the event fires for the first time the itemssource has added with no errors.
When the event fires for the second time i receive this Exception:
Eccezione di tipo 'System.InvalidOperationException' in Telerik.UI.Xaml.Input.DLL non gestita nel codice utente
Ulteriori informazioni: Failed to compare two elements in the array.
Thanks
I would like to change AutoCompleteBox's itemssource when users selecting a specific value in a ComboBox
I have tried like this:
Private Async Sub RicercaField_Cmb_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles RicercaField_Cmb.SelectionChanged
Dim sqlquery As String
Select RicercaField_Cmb.SelectedIndex
Case 2
'Me.RicercaTxt_Txt = New Telerik.UI.Xaml.Controls.Input.RadAutoCompleteBox
sqlquery = "SELECT Descrizione From Famiglia"
Dim db As New SQLite.SQLiteAsyncConnection(dbpath)
Me.RicercaTxt_Txt.ItemsSource = Nothing
Me.RicercaTxt_Txt.DisplayMemberPath = "Descrizione"
Me.RicercaTxt_Txt.FilterMode = Telerik.UI.Xaml.Controls.Input.AutoCompleteBoxFilterMode.Contains
Me.RicercaTxt_Txt.ItemsSource = Await db.QueryAsync(Of Famiglia)(sqlquery)
Case 3
sqlquery = "SELECT DISTINCT Marchio From Articolo"
Dim db As New SQLite.SQLiteAsyncConnection(dbpath)
Me.RicercaTxt_Txt.DisplayMemberPath = "Marchio"
Me.RicercaTxt_Txt.FilterMode = Telerik.UI.Xaml.Controls.Input.AutoCompleteBoxFilterMode.Contains
Me.RicercaTxt_Txt.ItemsSource = Nothing
Me.RicercaTxt_Txt.ItemsSource = Await db.QueryAsync(Of Articolo)(sqlquery)
Case Else
Me.RicercaTxt_Txt.ItemsSource = Nothing
End Select
End Sub
(RicercaTxt_Txt is my autocompletebox)
When the event fires for the first time the itemssource has added with no errors.
When the event fires for the second time i receive this Exception:
Eccezione di tipo 'System.InvalidOperationException' in Telerik.UI.Xaml.Input.DLL non gestita nel codice utente
Ulteriori informazioni: Failed to compare two elements in the array.
Thanks