Telerik Forums
UI for WPF Forum
0 answers
12 views

Hello!

I'm using a `<RadCartesianChart>` with `<ScatterAreaSeries> to visualize some data as a histogram.

I'd like the user to be able to select a data point in that chart.

I've been using this guide: https://docs.telerik.com/devtools/wpf/controls/radchartview/features/behaviors/selection
but nothing seems to work.

If I add

<telerik:RadCartesianChart.Behaviors>
    <telerik:ChartSelectionBehavior />
</telerik:RadCartesianChart.Behaviors>

I still can't seem to select anything. The `SelectionChanged` event also never arrives when I click on the chart.
When I set a random point as selected programmatically via:

RadCartesianChart chart = this.GetTemplateChild("Histogram_Chart") as RadCartesianChart;
var chartSeries = (ScatterAreaSeries)chart.Series[0];
ScatterDataPoint dataPoint = chartSeries.DataPoints[10];
dataPoint.IsSelected = true;

it still doesn't change how the chart looks.

Am I missing something or is selection just not possible for ScatterAreaSeries?

Thanks in advance!

Dominic
Top achievements
Rank 1
 asked on 30 Mar 2024
0 answers
14 views
how to set AvoidConnectionOverlap Property in diagram with example?
Parth
Top achievements
Rank 1
Iron
Iron
 asked on 29 Mar 2024
0 answers
15 views

Hello. Please give an idea to start with ...

I have RadWatermarkTextBox. And I've added INotifyDataErrorInfo to my VM implementation.

When DisplayMode  is Static - I can see validation errors. But When it's Tooltip telerik:ValidationErrorTemplateHelper.DisplayMode="ToolTip"
I can't see. 

By the way. if I use static mode I also don't see red bottom border line. And red arrow at top right corner, my error text is just a black font without read rectangle around and etc.

Looks like missing styles. But I can't understand which one. I imported xaml files for Win11 style. I see that there is a definition for RadWatermarkTextBox Validation Styles.

Valentin
Top achievements
Rank 1
 updated question on 28 Mar 2024
0 answers
10 views

Hello, 

im trying to set the focus on a ListBoxItem so the User can navigate to the next Index by pressing the down button.

Our current implementation is that the focus is set on the RadListBox itself and not on the item but you need to double press down to get the second item.

Is there some way to set the focus on the items itself rather than the ListBox?

I already tried something like this but this is not working.
 if (ListBox.SelectedItem != null)
 {
     var item = ListBox.ItemContainerGenerator.ContainerFromIndex(ListBox.SelectedIndex);
     if(item != null)
     {
         ((RadListBoxItem)item).Focus();
     }
     else
     {
         ListBox.Focus();
     }
 }

Marvin
Top achievements
Rank 1
 asked on 28 Mar 2024
2 answers
44 views

Hi,
I use windows8 theme but I need to make more clear the accent color without change the header color.
In other themes (for instance, Visual studio 2019) this option is allowed.Thank you

Luigi

Masha
Telerik team
 answered on 28 Mar 2024
1 answer
9 views

Hey,

as in the titel is there a event or workaround to know if a userer startet to type inside a pdf text field. I just need it to set a bool true to inform the user that there is a possibility to lose data.

 

Thanks

Dominik

Dimitar
Telerik team
 answered on 28 Mar 2024
1 answer
24 views

Hi,

I am exploring the RadCartesianChart component and would like to know if there is a way to determine the intersection point between two series. For example, I have a SplineSeries and a LineSeries, and I would like to know where they intersect. Is there a component or method to accomplish this?

I may be using the wrong component to try to achieve that?

 <telerik:RadCartesianChart x:Name="telerikChart">

     <telerik:RadCartesianChart.VerticalAxis>
         <telerik:LinearAxis Title="Distance (m)" DesiredTickCount="10"/>
     </telerik:RadCartesianChart.VerticalAxis>

     <telerik:RadCartesianChart.HorizontalAxis>
         <telerik:DateTimeContinuousAxis Title="Time (HH:mm)" LabelFormat="HH:MM" 
                                         TickOrigin="{Binding Origin}" MaximumTicks="14" MajorStepUnit="Hour" MajorStep="1"
                                         Minimum="{Binding Minimum}" Maximum="{Binding Maximum}" />
     </telerik:RadCartesianChart.HorizontalAxis>

     <telerik:RadCartesianChart.Series>
         <telerik:SplineSeries x:Name="barSerie1" CategoryBinding="Time" ValueBinding="Distance" ItemsSource="{Binding DistanceSeries}" ShowLabels="True" />
         <telerik:LineSeries x:Name="barSerie2" CategoryBinding="Time" ValueBinding="Distance" ItemsSource="{Binding AverageLineSeries}" ShowLabels="True"/>
     </telerik:RadCartesianChart.Series>

     <telerik:RadCartesianChart.Grid>
         <telerik:CartesianChartGrid MajorLinesVisibility="XY" />
     </telerik:RadCartesianChart.Grid>

 </telerik:RadCartesianChart>

 

Thanks for your time! 

Martin Ivanov
Telerik team
 answered on 27 Mar 2024
1 answer
19 views
I am using telerik's RadGridView as my datagrid and I want to make the search disabled when a toggle button is switched, the things I want are like so:
- When the user unchecks the toggle the search should clear and the user will still be able to type the searchbar but it will not execute any search 
- when the user checks the toggle if there is a text in the searchbar, the search will be executed based on that text and the user will be able to seach from now on

I tried this:
 private string searchText { get; set; }
 private void MainDatagrid_Searching(object sender, GridViewSearchingEventArgs e)
 {
     if (!(bool)showFilteredToggleButton.IsChecked)
     {
         e.Cancel = true;
         searchText = e.SearchText;
     }
     else
     {
         e.Cancel = false;
         searchText = e.SearchText;
     }
 }

 private void showFilteredToggleButton_Checked(object sender, RoutedEventArgs e)
 {
     if (!(bool)showFilteredToggleButton.IsChecked)
     {
         var clearSearchValue = GridViewSearchPanelCommands.ClearSearchValue as RoutedUICommand;
         clearSearchValue.Execute(null, MainDatagrid.ChildrenOfType<GridViewSearchPanel>().FirstOrDefault());
     }
     else
     {
         var searchBytextCommand = RadGridViewCommands.SearchByText as RoutedUICommand;
         searchBytextCommand.Execute(searchText, MainDatagrid);
     }
 }

But there are some features missing such as when user checks the toggle the search isn't initiated and when the user unchecks the toggle the searchbar clears itself but the search isn't cleared, old search remains. How can achieve the functionality I described? Can you help me?
Dimitar
Telerik team
 answered on 27 Mar 2024
0 answers
28 views

We recently updated to version 2024.1.312.  After the update, we get an exception (see stack trace below) or freezing with many of our RadToggleSwitchButtons.  It seems to only affect the ones that are backstage in a RadDataForm.  I found https://feedback.telerik.com/wpf/1645011-buttons-nullreferenceexception-when-setting-ischecked-of-radtoggleswitchbutton-before-the-control-is-added-to-the-visual-tree, but the workaround suggested there doesn't work for us, even if we leave the animations enabled.

System.NullReferenceException
  HResult=0x80004003
  Message=Object reference not set to an instance of an object.
  Source=Telerik.Windows.Controls
  StackTrace:
   at Telerik.Windows.Controls.RadToggleSwitchButton.OnIsCheckedPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.PropertyChangedCallback.Invoke(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.StyleHelper.ApplyTemplatedParentValue(DependencyObject container, FrameworkObject child, Int32 childIndex, FrugalStructList`1& childRecordFromChildIndex, DependencyProperty dp, FrameworkElementFactory templateRoot)
   at System.Windows.StyleHelper.InvalidatePropertiesOnTemplateNode(DependencyObject container, FrameworkObject child, Int32 childIndex, FrugalStructList`1& childRecordFromChildIndex, Boolean isDetach, FrameworkElementFactory templateRoot)
   at System.Windows.FrameworkTemplate.InvalidatePropertiesOnTemplate(DependencyObject container, Object currentObject)
   at System.Windows.FrameworkTemplate.HandleBeforeProperties(Object createdObject, DependencyObject& rootObject, DependencyObject container, FrameworkElement feContainer, INameScope nameScope)
   at System.Windows.FrameworkTemplate.<>c__DisplayClass45_0.<LoadOptimizedTemplateContent>b__2(Object sender, XamlObjectEventArgs args)
   at System.Xaml.XamlObjectWriter.OnBeforeProperties(Object value)
   at System.Xaml.XamlObjectWriter.Logic_CreateAndAssignToParentStart(ObjectWriterContext ctx)
   at System.Xaml.XamlObjectWriter.WriteStartMember(XamlMember property)
   at System.Xaml.XamlWriter.WriteNode(XamlReader reader)
   at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlReader templateReader, XamlObjectWriter currentWriter)
   at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlObjectWriter objectWriter)
   at System.Windows.FrameworkTemplate.LoadOptimizedTemplateContent(DependencyObject container, IComponentConnector componentConnector, IStyleConnector styleConnector, List`1 affectedChildren, UncommonField`1 templatedNonFeChildrenField)
   at System.Windows.FrameworkTemplate.LoadContent(DependencyObject container, List`1 affectedChildren)
   at System.Windows.StyleHelper.ApplyTemplateContent(UncommonField`1 dataField, DependencyObject container, FrameworkElementFactory templateRoot, Int32 lastChildIndex, HybridDictionary childIndexFromChildID, FrameworkTemplate frameworkTemplate)
   at System.Windows.FrameworkTemplate.ApplyTemplateContent(UncommonField`1 templateDataField, FrameworkElement container)
   at System.Windows.FrameworkElement.ApplyTemplate()
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.StackPanel.StackMeasureHelper(IStackMeasure measureElement, IStackMeasureScrollData scrollData, Size constraint)
   at System.Windows.Controls.StackPanel.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ItemsPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.ContextLayoutManager.UpdateLayout()
   at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
   at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   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)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(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)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(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.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at System.Windows.Application.Run()

 

Jennifer
Top achievements
Rank 1
Iron
 updated question on 26 Mar 2024
2 answers
36 views

I'm using a VirtualizingWrapPanel as the ItemsPanelTemplate of a RadListBox

<telerik:RadListBox x:Name="ItemControl"
                    Grid.Row="1"
                    VirtualizingPanel.ScrollUnit="Pixel"
                    ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:UserControl}}, Path=PathName}">

    <telerik:RadListBox.ItemsPanel>
        <ItemsPanelTemplate>
            <telerik:VirtualizingWrapPanel HorizontalAlignment="Center" ItemWidth="200" ItemHeight="180"/>
        </ItemsPanelTemplate>
    </telerik:RadListBox.ItemsPanel>

The ItemsSource is a ListCollectionView which is Live updating 

 


ListCollectionView = new(Models);
ListCollectionView.IsLiveSorting = true;

ListCollectionView.SortDescriptions.Add(new SortDescription("Percentage", ListSortDirection.Ascending));

The collection seems to be updating and reaching the UI; however, every so often I get empty cells in the RadListBox after a sorting happens.


If I scroll away and come back the area is filled in. Is there something I can do manually so that this area is filled in? Should I try reloading something in some way?

 

I've tried invalidating things in the wrap panel but this hasn't worked:

wrapPanel?.InvalidateArrange();
wrapPanel?.InvalidateMeasure();
wrapPanel?.InvalidateVisual();
wrapPanel?.UpdateLayout();

 

Any help or suggestions are appreciated

Martin Ivanov
Telerik team
 answered on 26 Mar 2024
Narrow your results
Selected tags
Tags
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?