Telerik Forums
UI for WPF Forum
9 answers
670 views

I have a C# WPF application using MVVM with a simple RadCartesianChart that shows a single ScatterLineSeries representing a surface profile.  It works well. 

Now I want to enable my user to mark out certain horizontal regions of the plot for use in my application.  The general idea is this

  1. User clicks a button that adds a visual indicator representing the region. 
  2. The indicator appears.  It looks like a big wide bar going from the bottom Y of the plot to the top Y and covering an arbitrary X width.
  3. The user can then use the mouse (or their finger) to made the bar wider/narrower or move it left or right across the plot

(I have attached an image showing roughly what this should look like.  It is from a much older version of this application that doesn't use C#, WPF or Telerik.)

My problem is not in writing interaction/manipulation code.  It is in determining exactly what Telerik entity I should interact with.  That is I don't know how best to achieve this with the tools Telerik gives me.   

I can think of several approaches. 

  • For example, I looked into using Chart Annotations.   They seem perfect for marking out chart regions and your examples are good.  But I can't find any examples that show me how the user might *interact* with them.    How do I add a mouse/touch handler for an annotation?   Is it possible?  Is that the best way?
  • Or maybe I should add mouse/touch handlers for the RadCartesianChart object.  Then in code-behind I could try to figure out what annotation my mouse/finger is over and go from there, is that the way?  
  • Or should I instead try to create my own buttons, completely separate from the cahrt that overlay the whole plot and match up exactly with chart plot area.  Is that the way to go?
  • Is there some other, cleaner way to achieve this?

 

My Chart in XAML is like this:

   

<tk:RadCartesianChart x:Name="Chart"
                         HorizontalAlignment="Stretch"
                         VerticalAlignment="Stretch"
                         Background="{StaticResource GsBackgroundDark}"
                         Foreground="{StaticResource GsForegroundLight}"
                         Height="300"
                         HoverMode="FadeOtherSeries"     
                         SelectionPalette="FlowerSelected"
                         ga:ChartUtilities.IsDragToSelectEnabled="True"
                         ga:ChartUtilities.SelectionRectangleStyle="{StaticResource SelectionRectangleStyle}"
                          
                         >
       <tk:RadCartesianChart.Resources>
           <Style x:Key="LabelStyle" TargetType="TextBlock">
               <Setter Property="Foreground" Value="{StaticResource GsForegroundLight}"/>
           </Style>
       </tk:RadCartesianChart.Resources>
       <tk:RadCartesianChart.HorizontalAxis>
           <tk:LinearAxis Title="{Binding Path=XAxisTitle}"
                          Foreground="{StaticResource GsForegroundLight}"
                          LabelStyle="{StaticResource LabelStyle}"
                          LabelFormat="0.00"
                          />
       </tk:RadCartesianChart.HorizontalAxis>
       <tk:RadCartesianChart.VerticalAxis>
           <tk:LinearAxis  x:Name="YAxis"
                           Title="{Binding Path=YAxisTitle}"
                           Foreground="{StaticResource GsForegroundLight}"
                           LabelStyle="{StaticResource LabelStyle}"
                           LabelFormat="0.00"   
                           />
       </tk:RadCartesianChart.VerticalAxis>
 
           <tk:RadCartesianChart.AnnotationsProvider>
               <tk:ChartAnnotationsProvider Source="{Binding Regions}">
                   <tk:ChartAnnotationDescriptor
                       d:DataContext="{d:DesignInstance gavm:ProfileRegionVm}">
                       <tk:ChartAnnotationDescriptor.Style>
                           <Style TargetType="tk:CartesianMarkedZoneAnnotation">
                               <Setter Property="VerticalFrom" Value="-1000" />
                               <Setter Property="VerticalTo" Value="1000" />
                               <Setter Property="HorizontalFrom" Value="{Binding HorizontalFrom}"/>
                               <Setter Property="HorizontalTo" Value="{Binding HorizontalTo}"/>
                               <Setter Property="Stroke" Value="Yellow"/>
                           </Style>
                       </tk:ChartAnnotationDescriptor.Style>
                   </tk:ChartAnnotationDescriptor>
               </tk:ChartAnnotationsProvider>
           </tk:RadCartesianChart.AnnotationsProvider>
            
       <tk:RadCartesianChart.Series>
           <tk:ScatterLineSeries ItemsSource="{Binding Path=ProfilePointsConverted}"
                                 XValueBinding="X"
                                 YValueBinding="Y"                          
                                 >
               <tk:ScatterLineSeries.LegendSettings>
                   <tk:SeriesLegendSettings Title="Profile"/>
               </tk:ScatterLineSeries.LegendSettings>
           </tk:ScatterLineSeries>
       </tk:RadCartesianChart.Series>
   </tk:RadCartesianChart>

My ProfileRegionVm class -- which represents an instance of this horizontal reagion is like this:

using System.Collections.Generic;
using GApp.Core.ViewModels;
using SWPoint = System.Windows.Point;
 
namespace GApp.Analyze.ViewModels
{
    public class ProfileRegionVm : BaseVm
    {
 
        public ProfileRegionVm()
        {
        }
 
        private List<SWPoint> _profilePoints;
 
        private List<SWPoint> Points
        {
            get => _profilePoints;
            set => SetProperty(ref _profilePoints, value);
        }
 
        private Sdk.Line _line;
 
        private Sdk.Line Line
        {
            get => _line;
            set => SetProperty(ref _line, value);
        }
 
        private string _name;
        public string Name
        {
            get => _name;
            set => SetProperty(ref _name, value);
        }
 
        private double _verticalFrom;
        public double VerticalFrom
        {
            get => _verticalFrom;
            set => SetProperty(ref _verticalFrom, value);
        }
 
 
        private double _verticalTo;
 
        public double VerticalTo
        {
            get => _verticalTo;
            set => SetProperty(ref _verticalTo, value);
        }
 
        private double _horizontalFrom;
 
        public double HorizontalFrom
        {
            get => _horizontalFrom;
            set => SetProperty(ref _horizontalFrom, value);
        }
 
 
        private double _horizontalTo;
 
        public double HorizontalTo
        {
            get => _horizontalTo;
            set => SetProperty(ref _horizontalTo, value);
        }
 
    }
}




Joe
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 07 Nov 2019
2 answers
182 views

Hi:

    I recently encountered a problem when using Edit Collections. I want to save the database immediately after editing Edit Collections.Is it possible to customize the Edit Collections template and add save buttons other than add and remove to achieve this?

Dilyan Traykov
Telerik team
 answered on 07 Nov 2019
5 answers
457 views

Hi Telerik-team,

Is it possible to select what columns should be shown in the dropdown from the GridViewMultiColumnComboBoxColumn, like it is possible in the RadMultiColumnComboBox? I could not find any documentation on that.

Thank you in advance!

 

Greetings, Mats

Dilyan Traykov
Telerik team
 answered on 06 Nov 2019
10 answers
231 views
Is there property I can bind to similar to SearchText in RadAutoCompleteBox?  I want the user to be able to add new item to the collection bound to the gird view.  Thanks.
Dilyan Traykov
Telerik team
 answered on 06 Nov 2019
3 answers
196 views
I am trying to use multiple series with ChartSeriesProvider in a bubble chart ScatterBubbleSeries. The examples I found show only one series binding. The code I wrote does not work but I am not sure ScatterBubbleSeries supports this mode at all... Is there any example of ScatterBubbleSeries binding multiple series with ChartSeriesProvider?
Martin Ivanov
Telerik team
 answered on 06 Nov 2019
1 answer
123 views

There are currently issues with RadWindow minimization after the latest version of the 2019 R3 SP1.

It works correctly when minimized by the Minimize button.
But, Click the icon on the Task Bar in Windows to minimize it, and then press the same button again to return it to its original state.
Almost the entire area behaves like a transparent state.

Test)
Set to RadWindowInteropHelper.AllowTransparency="False"

All but the left-top part of the title bar will be invisible to the screen.

 

The above issue is the same for WPF Demo Application.
With SP1 in place, is there a temporary solution to this issue?

Dimitar Dinev
Telerik team
 answered on 05 Nov 2019
4 answers
169 views

Good day! 

I have a problem with determination of selected items when IsVirtualizing="True". In attached project I used two different ways to counting selected items: 1. With binding IsSelected property, 2. Just counting of treeview SelectedItems. And both are incorrect in situation when selecting some number of treeview items by clicking with Shift button (SelectionMode="Extended"). For example, I select more than 8000 items but received next: items with IsSelected = true property: 37, selected tree view items: 980

Link to download project sample: click

Vladimir Stoyanov
Telerik team
 answered on 05 Nov 2019
7 answers
1.3K+ views

I have a exception when i try to filter the null value for the column, when having Null descriptor and other values as well.  The binding is a dynamic object, i am setting the column type as expected.

I am using the version 2019.2.618.45 of telerik dll

Argument types do not match
   at System.Linq.Expressions.Expression.Constant(Object value, Type type)
   at Telerik.Windows.Data.Expressions.OperatorValueFilterDescriptorExpressionBuilderBase.CreateBodyExpressionThreadSafe()
   at Telerik.Windows.Data.Expressions.FilterDescriptorCollectionExpressionBuilder.CreateBodyExpressionThreadSafe()
   at Telerik.Windows.Data.Expressions.FilterDescriptorCollectionExpressionBuilder.CreateBodyExpressionThreadSafe()
   at Telerik.Windows.Data.Expressions.FilterDescriptorCollectionExpressionBuilder.CreateBodyExpressionThreadSafe()
   at Telerik.Windows.Data.Expressions.FilterExpressionBuilder.CreateFilterExpression()
   at Telerik.Windows.Data.QueryableExtensions.Where(IQueryable source, CompositeFilterDescriptorCollection filterDescriptors)
   at Telerik.Windows.Data.QueryableCollectionView.CreateView()
   at Telerik.Windows.Data.QueryableCollectionView.CreateInternalList()
   at Telerik.Windows.Data.QueryableCollectionView.get_InternalList()
   at Telerik.Windows.Data.QueryableCollectionView.get_InternalCount()
   at Telerik.Windows.Data.DataItemCollection.get_Count()
   at Telerik.Windows.Controls.DataControl.ItemCoerce(DependencyObject d, Object baseValue)
   at System.Windows.DependencyObject.ProcessCoerceValue(DependencyProperty dp, PropertyMetadata metadata, EntryIndex& entryIndex, Int32& targetIndex, EffectiveValueEntry& newEntry, EffectiveValueEntry& oldEntry, Object& oldValue, Object baseValue, Object controlValue, CoerceValueCallback coerceValueCallback, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, Boolean skipBaseValueChecks)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at Telerik.Windows.Controls.DataControl.Telerik.Windows.Data.Selection.ISelectorInternal.set_SelectedItem(Object value)
   at Telerik.Windows.Data.Selection.ItemSelectionHandler.SynchronizePublicSelectedItem()
   at Telerik.Windows.Data.Selection.ItemSelectionHandler.SynchronizePublicPropertiesAndCleanUp()
   at Telerik.Windows.Data.Selection.ItemSelectionHandler.EndAllowedSelection(ItemSelectionChange selectionChange)
   at Telerik.Windows.Controls.GridView.Selection.CompositeSelectionHandler.PerformRowSelection(Object dataItem, SelectionModificationOptions modificationOptions)
   at Telerik.Windows.Controls.GridView.Selection.CellAndRowSelectionDispatcher.HandleSelectionForCellInput(GridViewCell cell, SelectionModificationOptions allowedModifications)
   at Telerik.Windows.Controls.GridView.GridViewDataControl.HandleMouseDownSelection(GridViewCell cell, Boolean allowDrag, Point mousePosition)
   at Telerik.Windows.Controls.GridView.GridViewCell.OnMouseLeftButtonDown(MouseButtonEventArgs e)
   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.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)
   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.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 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

 

Dilyan Traykov
Telerik team
 answered on 05 Nov 2019
1 answer
1.2K+ views

Hi Team,

       We are exporting our appointment details like below (code section) to generate .ics file. When we book an appointment in our WOOFware application, the email confirmation has an attached ICS file to add the appointment to the client's calendar.   The vcaappnt.ics attachment itself is working correctly.  However, if the client uses gmail, there is a banner at the top that allows them to add that ics to their Google calendar.

Issue:  When the appointment is close to a daylight savings time, the google calendar option is adding the appointment 1 hour later than the appointment. Please see the below,

Appointment time - Oct 31 @6 PM – 6.15PM EDT. But, in google it shows as 4.30am – 4.45am IST instead of 3:30am-3.45am IST. (please see the attachment - IST Time format)

Appointment time - Oct 31 @6 PM-6.15 PM EDT. But, in google it shows as 4pm – 4.15pmIST instead of 3pm-3.15pm IST.(please see the attachment - PDT Time format)

Code

using Telerik.Windows.Controls.ScheduleView;
ICalendar.AppointmentCalendarExporter exporter = new ICalendar.AppointmentCalendarExporter();
// appointment details exported(included timezone, location,time etc...)  
exporter.Export(appointments, sw);

The time zone will be PDT, EDT, CDT – and it will erroneously add 1 hour to the appointment(.ics file) and the time zone will say PST, EST, CST  and it will show the correct time

The actual .ics file is being generated using a Telerik library. That’s the one that is creating these RRULE entries in the .ics file.
So, different time gives in google and outlook using this .ics file? How to resolve this ?

Thanks,
Srinivasan


Uma
Top achievements
Rank 1
 answered on 05 Nov 2019
3 answers
292 views

Hi,

I want to override the select all filtering in radgridview to avoid stack over flow exception as mentioned below 

https://docs.telerik.com/devtools/wpf/controls/radgridview/filtering/faq/stackoverflow-exception

https://docs.telerik.com/devtools/wpf/controls/radgridview/filtering/how-to/howto-display-all-distinct-values

 

Is there a way I can create custom list and change the item source? 

Vladimir Stoyanov
Telerik team
 answered on 04 Nov 2019
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
InlineAIAssistant
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?