or
private List<
SupplierMaster
> foundSuppliers;
public List<
SupplierMaster
> FoundSuppliers
{
get { return foundSuppliers; }
set { if (foundSuppliers == value) return; foundSuppliers = value; OnPropertyChanged("FoundSuppliers"); }
}
private string searchText;
public string SearchText
{
get { return searchText; }
set { if (searchText == value) return; searchText = value; OnPropertyChanged("SearchText"); }
}
private void Search()
{
FoundSuppliers = (from sm in SupplierMaster where sm.SupplierName.ToUpperInvariant().StartsWith(SearchText.ToUpperInvariant()) select sm).ToList(); //Here the SearchText property is always null **ISSUE**
FoundSuppliers = FoundSuppliers.OrderBy(n => n.SupplierName).ToList(); }
}
XAML:
<
telerik:RadComboBox
Height
=
"23"
Name
=
"txtSearchBox"
TabIndex
=
"1"
HorizontalAlignment
=
"Left"
Width
=
"246"
IsEnabled
=
"True"
VerticalAlignment
=
"Top"
IsEditable
=
"True"
IsTextSearchEnabled
=
"True"
IsTextSearchCaseSensitive
=
"True"
Text
=
"{Binding SearchText}"
TextSearchMode
=
"StartsWithCaseSensitive"
Margin
=
"0,3"
ItemsSource
=
"{Binding SupplierMaster}"
DisplayMemberPath
=
"SupplierName"
SelectedValuePath
=
"SupplierName"
SelectedItem
=
"{Binding SelectedSupplier}"
EmptyText
=
"Name starts with..."
>
<
telerik:RadComboBox.ItemsPanel
>
<
ItemsPanelTemplate
>
<
VirtualizingStackPanel
/>
</
ItemsPanelTemplate
>
</
telerik:RadComboBox.ItemsPanel
>
</
telerik:RadComboBox
>
Dim tl As New TickList
tl.Name = "ticklist" & gauges.Count.ToString
Dim ctm As New CustomTickMark
ctm.Name = "CustomTickMark" & gauges.Count.ToString
ctm.Template = GetInternalLabel()
tl.Items.Add(ctm)
scale.Ticks.Add(tl)
Private Function GetInternalLabel() As ControlTemplate
Dim l As FrameworkElementFactory = New FrameworkElementFactory(GetType(TextBlock))
'l.SetValue(Ellipse.FillProperty, Brushes.AliceBlue)
'l.SetValue(Ellipse.MarginProperty, New Thickness(2))
l.SetValue(TextBlock.TextProperty, "Test")
Dim cv As FrameworkElementFactory = New FrameworkElementFactory(GetType(Canvas))
'grid.SetValue(Grid.MarginProperty, new Thickness(5));
cv.AppendChild(l)
Dim ct As New ControlTemplate(GetType(CustomTickMark))
'Dim cp As New ContentPresenter
'cp.Name = "cp" & gauges.Count.ToString
''Dim cv As New Canvas
''cv.Name = "cv" & gauges.Count.ToString
'cp.Content = cv
''Dim l As New TextBlock
''l.Name = "label" & gauges.Count.ToString
''l.Text = "test"
''cv.Children.Add(l)
ct.VisualTree = l
Return ct
End Function
System.ArgumentNullException was unhandled
Message=Value cannot be null.
Parameter name: reference
Source=PresentationCore
ParamName=reference
StackTrace:
at System.Windows.Media.VisualTreeHelper.HitTest(Visual reference, Point point)
at Telerik.Windows.Controls.Gauges.GaugeHelper.CheckPointOver(FrameworkElement element, Point point) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Gauge\GaugeHelper.cs:line 62
at Telerik.Windows.Controls.Gauges.GaugeHelper.CheckMouseOver(FrameworkElement element, MouseEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Gauge\GaugeHelper.cs:line 33
at Telerik.Windows.Controls.Gauges.ScaleBase.ScaleBase_MouseMove(Object sender, MouseEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Gauge\Scales\ScaleBase.cs:line 1426
at System.Windows.Input.MouseEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.MouseDevice.Synchronize()
at System.Windows.Input.MouseDevice.PostProcessInput(Object sender, ProcessInputEventArgs e)
at System.Windows.Input.InputManager.RaiseProcessInputEventHandlers(ProcessInputEventHandler postProcessInput, ProcessInputEventArgs processInputEventArgs)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at WPFDashboard.Application.Main() in C:\Users\jcrumpton\Documents\Visual Studio 2010\Projects\WPFDashboard\WPFDashboard\obj\x86\Debug\Application.g.vb:line 64
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
System.NullReferenceException occurred
Message=Object reference not set to an instance of an object.
Source=Telerik.Windows.Controls.GridView
StackTrace:
at Telerik.Windows.Controls.GridView.Automation.GridViewCellAutomationPeer.GetNameCore() in c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Controls\GridView\GridView\GridView\Automation\GridViewCellAutomationPeer.cs:line 146
InnerException: