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

[Solved] Failed to compare two elements in the array.

1 Answer 279 Views
AutoCompleteBox for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
manuele
Top achievements
Rank 1
manuele asked on 03 Oct 2014, 09:42 AM
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 



1 Answer, 1 is accepted

Sort by
0
Ivaylo Gergov
Telerik team
answered on 07 Oct 2014, 01:07 PM
Hello,

Unfortunately I was not able  to reproduce this exception using the provided code snippet. Could you please isolate this in a sample project so that we can further investigate what could be the reason?

I am looking forward to your reply.

Regards,
Ivaylo Gergov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
AutoCompleteBox for XAML
Asked by
manuele
Top achievements
Rank 1
Answers by
Ivaylo Gergov
Telerik team
Share this question
or