Telerik Forums
UI for WPF Forum
4 answers
375 views

We have a RadPane styled with IsHidden bound to a viewmodel property.

 <Style x:Key="PaneStyle" TargetType="{x:Type telerik:RadPane}">
   <Setter Property="CanUserClose" Value="False" />
   <Setter Property="CanFloat" Value="False" />
   <Setter Property="CanUserPin" Value="False" />
   <Setter Property="ContextMenuTemplate" Value="{x:Null}" />
   <Setter Property="IsPinned" Value="True" />
</Style>
<Style x:Key="PaneXStyle" TargetType="{x:Type telerik:RadPane}" BasedOn="{StaticResource PaneStyle}">
     <Setter Property="IsHidden" Value="{Binding HidePaneX}" />
</Style>
 

with the styles used like so:

<telerik:RadDocking AllowUnsafeMode="True">
   <telerik:RadDocking.DocumentHost>
     <telerik:RadSplitContainer>
       <telerik:RadPaneGroup>
        <telerik:RadPane Style="{StaticResource PaneStyle}" Header="Some Panes">
          <telerik:RadDocking AllowUnsafeMode="True">
            <telerik:RadDocking.DocumentHost>
              <telerik:RadSplitContainer>
                <telerik:RadPaneGroup>
                  <telerik:RadPane Style="{StaticResource PaneXStyle}" Header="PaneX">
       ......
 

After updating recently to v. 2021.1.325, we get the following exception.  We'd previously been on a very old version (2015 q1 sp1).

System.InvalidOperationException: Cannot modify the logical children for this node at this time because a tree walk is in progress.
   at System.Windows.FrameworkElement.RemoveLogicalChild(Object child)
   at MS.Internal.Controls.InnerItemCollectionView.ClearModelParent(Object item)
   at MS.Internal.Controls.InnerItemCollectionView._RemoveAt(Int32 index, Int32 indexR, Object item)
   at System.Windows.Controls.ItemCollection.Remove(Object removeItem)
   at Telerik.Windows.Controls.RadPaneGroup.ClosePane(RadPane pane) in c:\DeveloperTooling_Agent13\_work\103\s\Controls\Docking\Docking\Docking\RadPaneGroup.cs:line 671
   at Telerik.Windows.Controls.RadDocking.HidePane(RadPane pane) in c:\DeveloperTooling_Agent13\_work\103\s\Controls\Docking\Docking\Docking\RadDocking.cs:line 463
   at Telerik.Windows.Controls.RadPane.Close() in c:\DeveloperTooling_Agent13\_work\103\s\Controls\Docking\Docking\Docking\RadPane.cs:line 1566
   at Telerik.Windows.Controls.RadPane.OnIsHiddenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) in c:\DeveloperTooling_Agent13\_work\103\s\Controls\Docking\Docking\Docking\RadPane.cs:line 1319
   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.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)
   at System.Windows.Data.BindingExpressionBase.Invalidate(Boolean isASubPropertyChange)
   at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)
   at System.Windows.Data.BindingExpression.Activate(Object item)
   at System.Windows.Data.BindingExpression.OnDataContextChanged(DependencyObject contextElement)
   at System.Windows.Data.BindingExpression.HandlePropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)
   at System.Windows.Data.BindingExpressionBase.OnPropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)
   at System.Windows.Data.BindingExpression.OnPropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)
   at System.Windows.DependentList.InvalidateDependents(DependencyObject source, DependencyPropertyChangedEventArgs sourceArgs)
   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.TreeWalkHelper.InvalidateTreeDependentProperty(TreeChangeInfo info, DependencyObject d, FrameworkObject& fo, DependencyProperty dp, FrameworkPropertyMetadata fMetadata, Style selfStyle, Style selfThemeStyle, ChildRecord& childRecord, Boolean isChildRecordValid, Boolean hasStyleChanged, Boolean isSelfInheritanceParent, Boolean wasSelfInheritanceParent)
   at System.Windows.TreeWalkHelper.InvalidateTreeDependentProperties(TreeChangeInfo info, FrameworkElement fe, FrameworkContentElement fce, Style selfStyle, Style selfThemeStyle, ChildRecord& childRecord, Boolean isChildRecordValid, Boolean hasStyleChanged, Boolean isSelfInheritanceParent, Boolean wasSelfInheritanceParent)
   at System.Windows.FrameworkElement.InvalidateTreeDependentProperties(TreeChangeInfo parentTreeState, Boolean isSelfInheritanceParent, Boolean wasSelfInheritanceParent)
   at System.Windows.FrameworkElement.OnAncestorChangedInternal(TreeChangeInfo parentTreeState)
   at System.Windows.TreeWalkHelper.OnAncestorChanged(DependencyObject d, TreeChangeInfo info, Boolean visitedViaVisualTree)
   at System.Windows.DescendentsWalker`1._VisitNode(DependencyObject d, Boolean visitedViaVisualTree)
   at MS.Internal.PrePostDescendentsWalker`1._VisitNode(DependencyObject d, Boolean visitedViaVisualTree)
   at System.Windows.DescendentsWalker`1.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren)
   at System.Windows.DescendentsWalker`1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren)
   at System.Windows.DescendentsWalker`1.IterateChildren(DependencyObject d)
   at System.Windows.DescendentsWalker`1._VisitNode(DependencyObject d, Boolean visitedViaVisualTree)
   at MS.Internal.PrePostDescendentsWalker`1._VisitNode(DependencyObject d, Boolean visitedViaVisualTree)
   at System.Windows.DescendentsWalker`1.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren)
   at System.Windows.DescendentsWalker`1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren)
   at System.Windows.DescendentsWalker`1.IterateChildren(DependencyObject d)
   at System.Windows.DescendentsWalker`1.StartWalk(DependencyObject startNode, Boolean skipStartNode)
   at MS.Internal.PrePostDescendentsWalker`1.StartWalk(DependencyObject startNode, Boolean skipStartNode)
   at System.Windows.TreeWalkHelper.InvalidateOnTreeChange(FrameworkElement fe, FrameworkContentElement fce, DependencyObject parent, Boolean isAddOperation)
   at System.Windows.FrameworkElement.ChangeLogicalParent(DependencyObject newParent)
   at System.Windows.FrameworkElement.AddLogicalChild(Object child)
   at Telerik.Windows.Controls.RadDocking.OnLoaded(Object sender, RoutedEventArgs e) in c:\DeveloperTooling_Agent13\_work\103\s\Controls\Docking\Docking\Docking\RadDocking.cs:line 1756
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
   at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
   at MS.Internal.LoadedOrUnloadedOperation.DoWork()
   at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
   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)

 

For the time being, we instead bind IsEnabled to our VM property, but we'd like to be able to hide these panes again, please.

Additionally, the exception doesn't happen if the pane happens to be visible when the application starts; rather, it only happens if the pane is out of view (one of the other panes in the top-level Docking is foremost) and we browse to it later.  It is still docked during this time.

 

Is this a bug for which we should file a report?  Is there a different or better way to do this?

 

Dinko | Tech Support Engineer
Telerik team
 answered on 03 Jun 2021
1 answer
357 views

I have read the Telerik Article on Localization with UI for WPF but I am using the Telerik NuGet server and the assemblies it provides to not appear to match what is in that article.   

My application...

  • uses Telerik binaries *with* Xaml
  • uses the Telerik NuGet server to obtain its DLLs
  • has both English and French translations.

I see that the Telerik NuGet Server appears to provide two separate  assemblies related to each language.  For example, I see the following two assemblies with the ".fr" suffix for French

Telerik.Windows.Controls.for.Wpf.fr
Telerik.Windows.Controls.for.Wpf.Xaml.fr

What is the difference between these two?  Should I include them BOTH with my application or just one of them?

Vladimir Stoyanov
Telerik team
 answered on 03 Jun 2021
1 answer
162 views
How to save and load local themes
Martin Ivanov
Telerik team
 answered on 03 Jun 2021
2 answers
297 views

I am trying to display the data points in a ScatterLineSeries when the user clicks a button using the following code:

private void ShowDataPointsButton_Click(object sender, RoutedEventArgs e)
{
    foreach (var series in CartesianChart.Series)
    {
        if (series is ScatterLineSeries)
        {
            series.DefaultVisualStyle = Application.Current.Resources["DataPointStyle"] as Style;
        }
    }
}

(where `CartesianChart` is a `RadCartesianChart` control)

The style definition is as follows:

<Style x:Key="DataPointStyle" TargetType="{x:Type Path}">
    <Setter Property="Height" Value="5" />
    <Setter Property="Width" Value="5" />
</Style>

(I am using a palette to style the chart; hence the missing definition for `Fill`)

But for some reason, I have to follow these steps in order to see the data points styled:

  1. Press the `ShowDataPointsButton` button
  2. Zoom into the chart
  3. Press the `ShowDataPointsButton` button
  4. Press the `ShowDataPointsButton` button again

I have tried the following options to fix this issue:

  1. Remove the series from the chart -> Apply the style -> Add the series back into the chart
  2. Apply the style -> Force a redraw manipulating the zoom level on the chart
  3. Using the dispatcher associated with the series to force a redraw
  4. Using Application.Current.Dispatcher to apply the style with Render priority
  5. Binding a property to `DefaultVisualStyleProperty` and setting its value when user clicks the button

But in all these instances (except option 5 where the trial with binding did not work at all), I have to follow the steps mentioned up above to see the data points in the chart.

Could you please guide me on what is the right way to apply `DefaultVisualStyle` for a ScatterLineSeries in runtime from C# code-behind?

Vladimir Stoyanov
Telerik team
 answered on 02 Jun 2021
0 answers
322 views

I'm trying to create a custom column for my RadGridView, where upon editing the cell, an appropriate control is shown - A combobox for a boolean or an enumeration, a RadMaskedTextInput for text, and a RadMaskedNumericInput for numeric values.

I'm using the RadMaskedNumericInput as I need to set maximum and minimum values, and I've seen the samples of how to set minimum & maximum values for the RadMaskedNumericInput when in xaml, by using something like:

 <telerik:RadMaskedNumericInput maskedInput:MaskedInputExtensions.Minimum="0" /> 

However, as I'm creating the control dynamically in the Custom Column class, I can't find a way of doing the same in code? i.e. as part of creating the control using "RadMaskedNumericInput numericTb = new RadMaskedNumericInput();" I also have the same issue in trying to set the Min & Max length extensions for the RadMaskedTextInput control. 

Thanks

Ian
Top achievements
Rank 1
 asked on 02 Jun 2021
0 answers
678 views

Hello to all,

I have a new problem in the latest version of Telerik UI for WPF with the RadGridView control.

I get sporadic a NullReferenceException when I work with the control. Unfortunately it is not reproducible.

Hopefully someone can help me. Thank you in advance.

Here is the call stack of the exception:

Description: The process was terminated due to an unhandled exception.

Exception Info: System.NullReferenceException

   at Telerik.Windows.Controls.GridView.CommonColumnHeaderInfo.<get_MaxWidth>b__a(Telerik.Windows.Controls.GridViewColumn)

   at System.Linq.Enumerable+WhereSelectEnumerableIterator`2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Double, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()

   at System.Linq.Enumerable.Sum(System.Collections.Generic.IEnumerable`1<Double>)

   at Telerik.Windows.Controls.GridView.CommonColumnHeaderInfo.get_MaxWidth()

   at Telerik.Windows.Controls.GridView.GridViewCellsPanel.RealizeAndMeasureCells(Int32, Int32, System.Func`2<Int32,Int32>)

   at Telerik.Windows.Controls.GridView.CommonColumnHeadersPanel.UpdateVirtualizedCells()

   at Telerik.Windows.Controls.GridView.GridViewCellsPanel.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at MS.Internal.Helper.MeasureElementWithSingleChild(System.Windows.UIElement, System.Windows.Size)

   at System.Windows.Controls.ItemsPresenter.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Control.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Grid.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Border.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Control.MeasureOverride(System.Windows.Size)

   at Telerik.Windows.Controls.GridView.GridViewRowItem.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at Telerik.Windows.Controls.GridView.CommonHeaderPresenter+VirtualizingStrategy.MeasureOverride(System.Windows.Size)

   at Telerik.Windows.Controls.GridView.CommonHeaderPresenter.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Grid.MeasureCell(Int32, Boolean)

   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32, System.Windows.Size, Boolean, Boolean, Boolean ByRef)

   at System.Windows.Controls.Grid.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Control.MeasureOverride(System.Windows.Size)

   at Telerik.Windows.Controls.GridView.GridViewRowItem.MeasureOverride(System.Windows.Size)

   at Telerik.Windows.Controls.GridView.GridViewHeaderRow.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Grid.MeasureCell(Int32, Boolean)

   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32, System.Windows.Size, Boolean, Boolean, Boolean ByRef)

   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32, System.Windows.Size, Boolean, Boolean)

   at System.Windows.Controls.Grid.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.ScrollViewer.MeasureOverride(System.Windows.Size)

   at Telerik.Windows.Controls.GridView.GridViewScrollViewer.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Grid.MeasureCell(Int32, Boolean)

   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32, System.Windows.Size, Boolean, Boolean, Boolean ByRef)

   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32, System.Windows.Size, Boolean, Boolean)

   at System.Windows.Controls.Grid.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Control.MeasureOverride(System.Windows.Size)

   at Telerik.Windows.Controls.GridView.GridViewDataControl.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Border.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.DockPanel.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Grid.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at MS.Internal.Helper.MeasureElementWithSingleChild(System.Windows.UIElement, System.Windows.Size)

   at System.Windows.Controls.ContentPresenter.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Border.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Control.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at MS.Internal.Helper.MeasureElementWithSingleChild(System.Windows.UIElement, System.Windows.Size)

   at System.Windows.Controls.ContentPresenter.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Grid.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Grid.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Grid.MeasureCell(Int32, Boolean)

   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32, System.Windows.Size, Boolean, Boolean, Boolean ByRef)

   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32, System.Windows.Size, Boolean, Boolean)

   at System.Windows.Controls.Grid.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Control.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at Telerik.Windows.Controls.ProportionalStackPanel.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at MS.Internal.Helper.MeasureElementWithSingleChild(System.Windows.UIElement, System.Windows.Size)

   at System.Windows.Controls.ItemsPresenter.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Border.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Grid.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Control.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at MS.Internal.Helper.MeasureElementWithSingleChild(System.Windows.UIElement, System.Windows.Size)

   at System.Windows.Controls.ContentPresenter.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Border.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Control.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at Telerik.Windows.Controls.RadDockPanel.MeasureOverride(System.Windows.Size)

   at Telerik.Windows.Controls.DockingPanel.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at Telerik.Windows.Controls.RadDockPanel.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Border.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Grid.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Control.MeasureOverride(System.Windows.Size)

   at Telerik.Windows.Controls.RadDocking.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.DockPanel.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

  at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Grid.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Grid.MeasureCell(Int32, Boolean)

   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32, System.Windows.Size, Boolean, Boolean, Boolean ByRef)

   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32, System.Windows.Size, Boolean, Boolean)

   at System.Windows.Controls.Grid.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Border.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at MS.Internal.Helper.MeasureElementWithSingleChild(System.Windows.UIElement, System.Windows.Size)

   at System.Windows.Controls.ContentPresenter.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Documents.AdornerDecorator.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Controls.Border.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.Window.MeasureOverrideHelper(System.Windows.Size)

   at System.Windows.Window.MeasureOverride(System.Windows.Size)

   at System.Windows.FrameworkElement.MeasureCore(System.Windows.Size)

   at System.Windows.UIElement.Measure(System.Windows.Size)

   at System.Windows.ContextLayoutManager.UpdateLayout()

   at System.Windows.UIElement.UpdateLayout()

   at System.Windows.Interop.HwndSource.SetLayoutSize()

   at System.Windows.Interop.HwndSource.set_RootVisualInternal(System.Windows.Media.Visual)

   at System.Windows.Interop.HwndSource.set_RootVisual(System.Windows.Media.Visual)

   at System.Windows.Window.SetRootVisual()

   at System.Windows.Window.SetRootVisualAndUpdateSTC()

   at System.Windows.Window.SetupInitialState(Double, Double, Double, Double)

   at System.Windows.Window.CreateSourceWindow(Boolean)

   at System.Windows.Window.CreateSourceWindowDuringShow()

   at System.Windows.Window.SafeCreateWindowDuringShow()

   at System.Windows.Window.ShowHelper(System.Object)

   at System.Windows.Window.Show()

   at System.Windows.Window.ShowDialog()

   at Telerik.Windows.Controls.InternalWindow.WindowWithNoChromeWindowHost.Open(Boolean)

   at Telerik.Windows.Controls.WindowBase.ShowWindow(Boolean)

   at Telerik.Windows.Controls.RadWindow.ShowDialog()

   at SELMOstudio.App.Target(System.Object, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs)

   at System.Windows.Threading.Dispatcher.CatchException(System.Exception)

   at System.Windows.Threading.Dispatcher.CatchExceptionStatic(System.Object, System.Exception)

   at System.Windows.Threading.ExceptionWrapper.CatchException(System.Object, System.Exception, System.Delegate)

   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)

   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)

   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)

   at MS.Win32.UnsafeNativeMethods.CallWindowProc(IntPtr, IntPtr, Int32, IntPtr, IntPtr)

   at MS.Win32.HwndSubclass.DefWndProcWrapper(IntPtr, Int32, IntPtr, IntPtr)

   at MS.Win32.UnsafeNativeMethods.CallWindowProc(IntPtr, IntPtr, Int32, IntPtr, IntPtr)

   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)

 

The columns will be added programmatically in code behind:

                m_dgOperands.Columns.Clear();
                selectedColumn = null;

                //Add the known columns 
                m_dgOperands.Columns.Add(new GridViewDataColumn()
                {
                    Header = "#",
                    DataMemberBinding = new Binding("ID"),
                    IsReadOnly = true,
                    CellStyleSelector = new StepStyleSelector(),
                });

                m_dgOperands.Columns.Add(new GridViewDataColumn()
                {
                    Header = "Step",
                    DataMemberBinding = new Binding("Name"),
                    //IsReadOnly = true,
                    CellStyleSelector = new StepStyleSelector(),
                    MinWidth = 150,
                });

                columnGroupName = new GridViewDataColumn();
                columnGroupName.Header = "GroupName";
                columnGroupName.DataMemberBinding = new Binding("GroupName");
                columnGroupName.GroupMemberPath = "GroupName";
                columnGroupName.CellStyleSelector = new StepStyleSelector();
                m_dgOperands.Columns.Add(columnGroupName);

                m_dgOperands.Columns.Add(new GridViewDataColumn()
                {
                    Header = "Info",
                    DataMemberBinding = new Binding("InfoText"),
                    IsReadOnly = true,
                    CellStyleSelector = new StepStyleSelector(),
                    CellTemplate = (DataTemplate)base.Resources["GridViewCellImageTextTemplate"],
                });

                m_dgOperands.Columns.Add(new GridViewDataColumn()
                {
                    Header = "",
                    IsReadOnly = true,
                    Width = 3,
                    MaxWidth = 3,
                    IsResizable = false
                });

                m_dgOperands.FrozenColumnCount = 4;

                foreach (var zone in seq.Zones)
                {
                    var item = new GridViewDataColumn();
                    item.UniqueName = zone.ID.ToString();
                    item.Header = zone.Name;
                    item.Footer = zone.Name;
                    item.DataMemberBinding = new Binding("ZoneValues[" + zone.ZoneValueIndex + "]");
                    item.Tag = zone;
                    item.CellStyleSelector = new ZoneStyleSelector();
                    item.IsVisible = zone.Visible;

                    CheckColumnGroup(zone, item);
                    m_dgOperands.Columns.Add(item);

                    SetZoneHeaderStyle(zone);
                    SelmoCreatorSequence_PropertyChanged(zone, new PropertyChangedEventArgs("ShowSystemZone"));
                }

                m_dgOperands.ItemsSource = seq.Steps;

cwider
Top achievements
Rank 1
Iron
 asked on 02 Jun 2021
2 answers
516 views

I did all I can Still I cannot take away the line spacing after hitting  "Enter", I could not get it working  (looks like the DocumentInheritsDefaultStyleSettings  is interfering?)

I have uploaded a sample project (that tells the behavior) as well.

 

Please find the code I used below.

                                <telerik:RadRichTextBox x:Name="custNotesRichTextBox"
                                                        Grid.Row="0"
                                                        DocumentInheritsDefaultStyleSettings="True"                                                     
                                                        AcceptsTab="True"
                                                        AcceptsReturn="True"                                                         
                                                        ScrollViewer.VerticalScrollBarVisibility="Auto"
                                                        HorizontalScrollBarVisibility="Hidden"                                                        
                                                        IsSpellCheckingEnabled="True"
                                                        Language="en-US"
                                                        IsContextMenuEnabled="True"                                                        
                                                        Margin="0"
                                                        VerticalScrollBarVisibility="Hidden">
                                    <telerik:RadRichTextBox.Document>
                                    <telerik:RadDocument LineSpacing="0" LineSpacingType="AtLeast" ParagraphDefaultSpacingAfter="0" ParagraphDefaultSpacingBefore="0" >
                                        <telerik:Section>
                                                <telerik:Paragraph LineSpacing="0" LineSpacingType="AtLeast" SpacingBefore="0" SpacingAfter="0" AutomaticSpacingBefore="False" AutomaticSpacingAfter="False" >
                                                <telerik:Span  Text=" "/>
                                            </telerik:Paragraph>
                                        </telerik:Section>
                                    </telerik:RadDocument>
                                    </telerik:RadRichTextBox.Document>
                                    </telerik:RadRichTextBox>
Dimitar
Telerik team
 answered on 02 Jun 2021
1 answer
169 views

Hi,

I am having an issue with RadDiagramConnections not binding from the source to the target on RadTabItems after the 1st tab. Here is my UserControl layout.

  1. I have UserControl with a RadTabControl with 2 RadTabItems.
  2. Each RadTabItem contains a RadDiagram (each with multiple RadDiagramShapes and RadDiagramConnections).

The 1st RadTabItem Diagram loads as it should (no issues). The 2nd RadTabItem diagram only loads the shapes and not the connections. During initialization of the software, Visual Studio Output window shows "Cannot find source for binding with reference" for all of the connections on the 2nd diagram. How do I get the Connections to load properly? 

Martin Ivanov
Telerik team
 answered on 02 Jun 2021
1 answer
123 views
I can create Chart view showing pass or fail  but I need something which also shows a blur red color behind the bar indicating an intense bad  situation  base on the data , as example you can see in the attached image. Is it possible using WPF toolset?
Martin Ivanov
Telerik team
 answered on 02 Jun 2021
1 answer
94 views

Hi.. 

I'm trying to implement a Custom Filter for a computed column in RadGridView.

The computed column is simply a Year-range eg: "2010-2015" - i want to filter all rows that contains a given year, eg: 2013.

Tthe computed column is using this type, where i've added the IEquitable interface. 

public class YearRange : IEquatable<int>
{
    public int FromYear { get; set; }

    public int ToYear { get; set; }

    public override string ToString()
    {
        return FromYear + "-" + ToYear;
    }

    public bool Equals(int other)
    {
        return FromYear >= other && other <= ToYear;
    }
}

The CustomGridFilter is implemented like this, where i've copied the telerik sample and modified it a bit. 

public partial class CustomGridFilter : UserControl, IFilteringControl
    {
        private GridViewBoundColumnBase column;
        private CompositeFilterDescriptor compositeFilter;
        private FilterDescriptor rangeFilter;

        #region IsActive DependencyProperty 
        public bool IsActive
        {
            get { return (bool)GetValue(IsActiveProperty); }
            set { SetValue(IsActiveProperty, value); }
        }

        public static readonly DependencyProperty IsActiveProperty =
            DependencyProperty.Register(
                "IsActive",
                typeof(bool),
                typeof(CustomGridFilter),
                new PropertyMetadata(false));
        #endregion

        #region Aargang DependencyProperty 

        public int Aargang
        {
            get { return (int)GetValue(AargangProperty); }
            set { SetValue(AargangProperty, value); }
        }

        public static readonly DependencyProperty AargangProperty =
            DependencyProperty.Register(
                "Aargang",
                typeof(int),
                typeof(CustomGridFilter),
                new PropertyMetadata(0)
            );

        #endregion

        public CustomGridFilter()
        {
            InitializeComponent();

            DataContext = this;
        }

        public void Prepare(Telerik.Windows.Controls.GridViewColumn column)
        {
            this.column = column as GridViewBoundColumnBase;

            if (this.column == null)
            {
                return;
            }

            if (compositeFilter == null)
            {
                CreateFilters();
            }
        }

        private void CreateFilters()
        {
            string dataMember = column.DataMemberBinding.Path.Path;

            compositeFilter = new CompositeFilterDescriptor();

            rangeFilter = new FilterDescriptor(dataMember, FilterOperator.IsEqualTo, null);

            compositeFilter.FilterDescriptors.Add(rangeFilter);
        }

        private void OnFilter(object sender, RoutedEventArgs e)
        {
            rangeFilter.Value = Aargang;

            if (!column.DataControl.FilterDescriptors.Contains(compositeFilter))
            {
                column.DataControl.FilterDescriptors.Add(compositeFilter);
            }

            IsActive = true;

            var popup = this.ParentOfType<System.Windows.Controls.Primitives.Popup>();
            if (popup != null)
            {
                popup.IsOpen = false;
            }
        }

        private void OnClear(object sender, RoutedEventArgs e)
        {
            if (column.DataControl.FilterDescriptors.Contains(compositeFilter))
            {
                column.DataControl.FilterDescriptors.Remove(compositeFilter);
            }

            Aargang = 0;

            IsActive = false;

            var popup = this.ParentOfType<System.Windows.Controls.Primitives.Popup>();
            if (popup != null)
            {
                popup.IsOpen = false;
            }
        }
    }

The XAML is simply a textbox bound to the Aargang DependencyProperty which is functioning correctly considering the error message. 

My assumption is that IEquiatable<int> is supposed to execute the FilterOperator.IsEqualTo comparison ?

Why does it fail ?

EDIT: 

Debugging the "solution" from this question, https://www.telerik.com/forums/problem-with-custom-filter-with-custom-type - i've found that IEquatable is used for the GetDistinctValues operation while the ACTUAL comparison uses standard override Equals operator ... FFS... 

 

Martin
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 01 Jun 2021
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
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?