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

ComboBox and TextSearch = Exception

1 Answer 82 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Michele
Top achievements
Rank 2
Michele asked on 11 Mar 2010, 04:37 PM
Hello,
I got this strange behavior siunce Q2 but since it happens only on my dev machine and not in production I was not too much intrested in the cause... the problem is I've got a RadComboBox with TextSearch enabled.... I've got almost 13000 items in the combobox and when I start typing I got this exception

Microsoft JScript runtime error: Sys.InvalidOperationException: ManagedRuntimeError error #4004 in control 'Xaml1': System.NullReferenceException: Object reference not set to an instance of an object. <br>&nbsp;&nbsp; at System.Windows.DependencyPropertyChangedWeakListener.Disconnect() <br>&nbsp;&nbsp; at System.Windows.DependencyPropertyChangedWeakListener.SourcePropertyChanged(DependencyObject c, DependencyProperty dp) <br>&nbsp;&nbsp; at System.Windows.DPChangedEventHandler.Invoke(DependencyObject sender, DependencyProperty dp) <br>&nbsp;&nbsp; at System.Windows.DependencyObject.OnPropertyChanged(DependencyProperty dp) <br>&nbsp;&nbsp; at System.Windows.FrameworkElement.OnPropertyChanged(DependencyProperty dp) <br>&nbsp;&nbsp; at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet, Boolean isSetByStyle, Boolean isSetByBuiltInStyle, PropertyInvalidationReason reason) <br>&nbsp;&nbsp; at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value) <br>&nbsp;&nbsp; at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value) <br>&nbsp;&nbsp; at Telerik.Windows.Controls.RadComboBox.set_Text(String value) <br>&nbsp;&nbsp; at Telerik.Windows.Controls.RadComboBox.TextUpdated(String newText, Boolean textBoxUpdated) <br>&nbsp;&nbsp; at Telerik.Windows.Controls.RadComboBox.OnEditableTextBoxTextChanged(Object sender, TextChangedEventArgs e) <br>&nbsp;&nbsp; at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args) <br>&nbsp;&nbsp; at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)  


Here's my code :

cs file :

 
public partial class Inserimento : UserControl, IParentHoldCliente, IDisposable, IParentHoldFondo <br>&nbsp;&nbsp;&nbsp; { <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #region Variables <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private IFWebLight.DO.IFMondoAParte.MondoAParteClient clientMAP; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private IFWebLight.DO.IFPosizione.PosizioneClient clientPOS; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private Cliente m_Cliente; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private ClientDataSource clientDataSource; <br>&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private double m_qty = 0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private double m_nav = 0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private double m_ctv = 0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private DateTime m_OrderTime; <br>[...] <br>&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp; private void LoadClientList() <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (App.m_ListaCliente == null) <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clientPOS.GetListaClientiAsync(App.UserName); <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cbNDG.IsEnabled = true<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clientDataSource = new ClientDataSource(App.m_ListaCliente, "D"); <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cbNDG.DataContext = clientDataSource<br>&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clientMAP.GetModalitaRicezioneOrdiniAsync(App.UserName); <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }  

 
and XAML :

&nbsp; &lt;StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Orientation="Horizontal" Margin="0,5,0,0" &gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;TextBlock Text="Dossier" TextAlignment="Left" Margin="5,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" Width="100" Height="16"/&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;telerikInput:RadComboBox GotFocus="cbNDG_GotFocus"&nbsp; Margin="10,0,0,0" x:Name="cbNDG" Height="16" Width="120" IsTextSearchEnabled="False" IsEditable="True" IsEnabled="False" KeyDown="cbNDG_KeyDown" <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Text="{Binding Text, Mode=TwoWay}" SelectionChanged="cbNDG_SelectionChanged"&nbsp; Tag="NDG" ItemsSource="{Binding FoundClient}" DisplayMemberPath="D"/&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;TextBox x:Name="tbIntestatario" HorizontalAlignment="Right" TextWrapping="Wrap" Width="190" Background="LightGray" IsReadOnly="True" /&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Button x:Name="btnSearchCliente" Margin="5,0,0,0" Content="Search" HorizontalAlignment="Right" Width="40" Height="20" FontSize="10" Click="btnSearchCliente_Click" /&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/StackPanel&gt;  


Hope it helps...
Thanks






1 Answer, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 12 Mar 2010, 04:28 PM
Hi Paolo,

I guess you already enabled the virtualization of RadComboBox, since it is not very useful with 1000+ items and no virtualization. It is possible that the older versions contain bugs related to this scenario so I would recommend trying the latest internal build of the control, available here:
http://www.telerik.com/account/downloads/internal-builds.aspx

If the problem persists, I would like to kindly ask you for a simple application that could be used to observe the problem.

All the best,
Valeri Hristov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
ComboBox
Asked by
Michele
Top achievements
Rank 2
Answers by
Valeri Hristov
Telerik team
Share this question
or