Telerik Forums
UI for WPF Forum
4 answers
1.8K+ views
Hi,

I am having a hard time figuring out how to make the Text property of the RadComboBox bind to a string property in my View Model.  I have a combo box that is Editable so that user can search for anything that starts with the values typed on the text box.  I want to get that value in the view model, use it as part of a LINQ query (sarts with), and fill a collection source to display on a view.

The problem:
------------------
The string property on my view model "SearchText" is returning null (never gets the value entered by user).  Sample code is below:

        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>


Please advice if this is possible or if I am missing something.

Thanks,

Gabe.
John
Top achievements
Rank 1
 answered on 16 Sep 2011
1 answer
109 views
Can any of the telerik controls make a true "heatmap" ..  i.e. one that's based strictly on data and not laid over an actual geographical map.

Something like: 

http://finviz.com/map.ashx?t=sec

In that case, the data set is something along the lines of:

Sector (Light Blue)
Sub-Sector (Yellow)
Symbol - label for each box
Market Cap - Size of each box
Today's return - Color of each box, scaled from -3 for red to +3 for green.

Syncfusion has this: http://www3.syncfusion.com/products/user-interface-edition/wpf/chart/heat-map

?

-Peter
Bartholomeo Rocca
Top achievements
Rank 1
 answered on 16 Sep 2011
1 answer
70 views
Is there a way to display a message to the user when the bound collection is empty?
I was able to add a custom class to do this for the GridView, but I need to be able to do this with the Tab Control. Right now, it just appears to be blank and I'd like to display a message informing the user on how to create the collection.
Tina Stancheva
Telerik team
 answered on 16 Sep 2011
1 answer
78 views
Is there a built in way to force the data entry on the RadDataForm to upper case as the user types?
Pavel Pavlov
Telerik team
 answered on 16 Sep 2011
5 answers
185 views
I am creating the Gauges in code (based on a config file) with a Scale, Ranges, and Indicator Needle... mostly from these two examples: http://www.telerik.com/community/forums/wpf/gauges/how-to-build-and-create-dynamic-indicator-in-vb-code-instead-of-xml.aspx and http://www.telerik.com/community/forums/wpf/gauges/adding-gauge-only-with-code.aspx. It works well so far.
I would also like to add a CustomTickMark to the Gauges similar to this post... http://www.telerik.com/community/forums/wpf/gauges/how-do-i-make-a-label-inside-a-gauge.aspx but  I need to do it in code rather than XAML. There are several variations of the code I have tried below... none of them seem to work. No label is displayed and also, it throws an error (below) when it's run.

Any help/info/example would be very much appreciated.
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:
Sia
Telerik team
 answered on 16 Sep 2011
1 answer
122 views
After installing 2011 Q2, I get a NullReferenceException:
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:
 
This happens after I load the data (22 rows). The first 11 are visible. It happens repeatedly with this set of data but no problem with other data. Went back to 20010 Q2 SP2 and it works fine.
Vlad
Telerik team
 answered on 16 Sep 2011
4 answers
185 views
Hello,
I am using a hierachical RadGridView and when i expand a GridViewRow, the first time it expands, the childDataControls list count is 0. If i collapse the row , the event is fired again and the childDataControls list is populated. I need to get the row's childDataControls on the first expand event, is it possible? 

I'm trying to select a row's childDataControl (RadGridView) the first time that row  is expanded.
What would a different approach be?

private void myGrid_RowIsExpandedChanged(object sender, RowEventArgs e)
        {
            GridViewRow r = e.Row as GridViewRow;
            var childControls = r.ChildDataControls;
        }
Vlad
Top achievements
Rank 1
 answered on 16 Sep 2011
0 answers
148 views
I have a TreeListView that is bound to an ObservableCollection datasource.

 In the radTreeListView1_CellValidating method I change another cells value depending on certain things. That change is not visible on the TreeListView. But if i click on the cell that was suppose to change. It's value updates to what it should be..

So it looks like datasource gets the change but the view does not refresh until cell gets focus.

Help?
Jessica
Top achievements
Rank 1
 asked on 15 Sep 2011
1 answer
99 views
I use the latest internal build RadControls_for_WPF40_2011_2_0912_DEV_hotfix.

It seems like the RichTextBoxUI:RadRichTextBoxRibbonUI.RichTextCommand="{Binding Path=OpenDocumentCommand} 
no longer likes to open *.docx -files.
Iva Toteva
Telerik team
 answered on 15 Sep 2011
1 answer
116 views
Hello There,
 
I need help from you ! As I am using WPF Telerik controls RAD Tree View. I want to add a file name as item when I am dragging and dropping a file from windows explorer on to tree view.
 

Quick reply is very help fulll .!
 
ThnQ
Naresh
Petar Mladenov
Telerik team
 answered on 15 Sep 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?