Telerik Forums
UI for WPF Forum
3 answers
128 views
Hi,


I have the following error when run my application on Windows 8:
(I have the following version of telerik (Runtime Version: v4.0.30319, Version: 2014.2.617.40)

[1] App - Unhandled exception happened! - System.NullReferenceException: Object reference not set to an instance of an object. 
at Telerik.Windows.Controls.RadPropertyGrid.OnTapDown(FrameworkElement originalSource) 
at Telerik.Windows.Controls.Data.PropertyGrid.PropertyGridTouchableElement.TapDown(TapDownArguments args) 
at Telerik.Windows.Input.Touch.GestureHandlers.TapGestureHandler.TapUp(Point point) 
at Telerik.Windows.Input.Touch.TouchHandler.RegisterTouchUp(TouchHandlerArgs args) 
at Telerik.Windows.Input.Touch.TouchHandlersController.RegisterTouchUp(Point point, TouchPoint[] touchPoints, Boolean& handled) 
at Telerik.Windows.Input.Touch.TouchHandlersController.Owner_TouchUp(Object sender, TouchEventArgs e) 
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) 
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.TouchDevice.ReportUp() 
at System.Windows.Input.StylusLogic.PromoteMainUpToTouch(StylusDevice stylusDevice, StagingAreaInputItem stagingItem) 
at System.Windows.Input.StylusLogic.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.StylusLogic.InputManagerProcessInput(Object oInput) 
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).


How can I fix this error?

Thanks

Ciro










Stefan
Telerik team
 answered on 05 Nov 2015
2 answers
164 views

How can I binding header and content of items?

<telerik:RadTileView ItemsSource="{Binding BankAccounts}" IsVirtualizing="True"/>

 My goal is show my ​entities (for ex. Bank Account).

To show account's name on header livetimeitem and to list several properties of entities (for ex. Balance Amount, last ledger entry etc.) into content.

Dario
Top achievements
Rank 2
 answered on 05 Nov 2015
2 answers
614 views

Hi,

My users need to be able to select cells in a RadGridView by clicking the column header. What is the recommended way of accomplishing this, in a RadGridView (WPF). Thanks in advance for any help.

 

// Tomas

Tomas
Top achievements
Rank 1
 answered on 05 Nov 2015
5 answers
1.3K+ views

I'm using the ribbon with MVVM, like in the sample.  In my implementation I've got tabs with a lot of buttons on them.  When I select a tab, it can take a couple of seconds to switch to it and display the contents.  Also, sometimes when the lag is noticeable and you can see the layout change as the buttons are added to the visual tree.

 

I've looked into implementing the solution described here, but I can't find the RadTabControl in the visual tree to set the IsContentPreserved property.  So I'm at a loss at this point on how to make it better.

 

Is there a way to improve the performance when switching between tabs?

 

Thanks for any help!

Kiril Vandov
Telerik team
 answered on 05 Nov 2015
1 answer
440 views
Hi,

I'm actually plotting different kind of series (StepLine, Line, Point etc) on a unique rad cartesian chart, where the X axis is a DateTimeContinuousAxis and the Y axis is a LinearAxis. I added to the Chart behavior a ChartCrosshairBehavior control to let the user see both the Y and X values of the points he is pointing to with the mouse.

Since the date time format of the vertical label of the ChartCrosshairBehavior control is not the same of the x axis one (the one of the x axis is "HH:mm", defined by me, while the label one is "dd/mm/yyyy hh:mm", which I suppose was inherited) I was trying to change it, without success. 

How could I change it to "HH:mm"? Is it correct to set the VerticalLineLabelDefinition property format of the ChartCrosshairBehavior control? If yes, how?

Many thanks

Alessandro
Peshito
Telerik team
 answered on 05 Nov 2015
1 answer
146 views

Hello everyone, 

 I'm new with Telerik test studio and really need your ​advises on thing below, please help...

 I have a WPF app that alows many users work at the same time (each user will work on a difference workstation and currently i have 16 users with 16 workstation), and now i want to using automation test to replicate the scenario that 16users working at the same time.

So is impossible to do it? and how can i do it?

Currently i only create a testing with a user (on a workstation) and for 15 others, i create 15 virtual machines to run my testing. But seems it is a bad thinking..

Hope to get all your helps.

Many many thanks...

Ivaylo
Telerik team
 answered on 05 Nov 2015
3 answers
713 views

I'm getting an "Ambiguous match found" exception when loading a control with the RadGridView on it. The error is only happening on a few user's PCs and is fine on all the others and there's nothing obviously different about these PCs or the setup.

 Are there any known issues that might cause this?

The stack trace is below and you'll see there's none of my code in there - it's purely Windows forms loading and I think formatting rows in the control. The affected PCs are based in Ireland and we are using regional formats on some of the data. There's a DataCellTemplateSelector that determines whether to format a row using one of the following string formats: {}{0:#,#.}, {}{0:C2}, {}{0:C0} or {}{0:#,#.%}

 Thanks

 

Stack Trace:

AmbiguousMatchException
   at System.RuntimeType.GetPropertyImpl(String name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
   at System.Type.GetProperty(String name, BindingFlags bindingAttr)
   at System.Windows.PropertyPath.GetPropertyHelper(Type ownerType, String propertyName)
   at System.Windows.PropertyPath.ResolvePropertyName(String name, Object item, Type ownerType, Object context, Boolean throwOnError)
   at MS.Internal.Data.PropertyPathWorker.GetInfo(Int32 k, Object item, SourceValueState& svs)
   at MS.Internal.Data.PropertyPathWorker.ReplaceItem(Int32 k, Object newO, Object parent)
   at MS.Internal.Data.PropertyPathWorker.UpdateSourceValueState(Int32 k, ICollectionView collectionView, Object newValue, Boolean isASubPropertyChange)
   at MS.Internal.Data.ClrBindingWorker.AttachDataItem()
   at System.Windows.Data.BindingExpression.Activate(Object item)
   at System.Windows.Data.BindingExpression.AttachToContext(AttachAttempt attempt)
   at System.Windows.Data.BindingExpression.AttachOverride(DependencyObject target, DependencyProperty dp)
   at System.Windows.Data.BindingExpressionBase.Attach(DependencyObject target, DependencyProperty dp)
   at System.Windows.Data.BindingExpressionBase.OnAttach(DependencyObject d, DependencyProperty dp)
   at System.Windows.StyleHelper.GetInstanceValue(UncommonField`1 dataField, DependencyObject container, FrameworkElement feChild, FrameworkContentElement fceChild, Int32 childIndex, DependencyProperty dp, Int32 i, EffectiveValueEntry& entry)
   at System.Windows.StyleHelper.GetChildValueHelper(UncommonField`1 dataField, ItemStructList`1& valueLookupList, DependencyProperty dp, DependencyObject container, FrameworkObject child, Int32 childIndex, Boolean styleLookup, EffectiveValueEntry& entry, ValueLookupType& sourceType, FrameworkElementFactory templateRoot)
   at System.Windows.StyleHelper.GetChildValue(UncommonField`1 dataField, DependencyObject container, Int32 childIndex, FrameworkObject child, DependencyProperty dp, FrugalStructList`1& childRecordFromChildIndex, EffectiveValueEntry& entry, ValueLookupType& sourceType, FrameworkElementFactory templateRoot)
   at System.Windows.StyleHelper.GetValueFromStyleOrTemplate(FrameworkObject fo, DependencyProperty dp, EffectiveValueEntry& entry)
   at System.Windows.StyleHelper.ApplyStyleOrTemplateValue(FrameworkObject fo, DependencyProperty dp)
   at System.Windows.StyleHelper.InvalidateContainerDependents(DependencyObject container, FrugalStructList`1& exclusionContainerDependents, FrugalStructList`1& oldContainerDependents, FrugalStructList`1& newContainerDependents)
   at System.Windows.StyleHelper.DoStyleInvalidations(FrameworkElement fe, FrameworkContentElement fce, Style oldStyle, Style newStyle)
   at System.Windows.StyleHelper.UpdateStyleCache(FrameworkElement fe, FrameworkContentElement fce, Style oldStyle, Style newStyle, Style& styleCache)
   at System.Windows.FrameworkElement.OnStyleChanged(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.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.GridView.GridViewDataControl.ApplyRowStyle(GridViewRow row, Boolean& isExpandablePropertyCleared)
   at Telerik.Windows.Controls.GridView.GridViewDataControl.PrepareContainerForItemOverride(DependencyObject element, Object item)
   at Telerik.Windows.Controls.GridView.BaseItemsControl.Telerik.Windows.Controls.GridView.IGeneratorHost.PrepareItemContainer(DependencyObject container, Object item)
   at Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.System.Windows.Controls.Primitives.IItemContainerGenerator.PrepareItemContainer(DependencyObject container)
   at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.NestedLayoutStrategy.InsertContainer(Int32 childIndex, UIElement container, Boolean isRecycled)
   at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.NestedLayoutStrategy.AddContainerFromGenerator(Int32 childIndex, UIElement child, Boolean newlyRealized)
   at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.NestedLayoutStrategy.GenerateNextChild(IItemContainerGenerator generator, Int32 childIndex)
   at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.NestedLayoutStrategy.MeasureOverride(Size constraint)
   at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.MeasureOverride(Size availableSize)
   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 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, 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.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 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 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()

Maya
Telerik team
 answered on 04 Nov 2015
3 answers
269 views

I have a User Control with this RadChart defined in xaml:

<telerik:RadChart Grid.Row="1" HorizontalAlignment="Center" Margin="0,0,0,0" VerticalAlignment="Center" Name="radChart"  >
    <telerik:RadChart.SeriesMappings>
        <telerik:SeriesMapping LegendLabel="Fin" >
            <telerik:SeriesMapping.SeriesDefinition>
                <telerik:SplineSeriesDefinition ShowItemToolTips="True" ShowItemLabels="False" ShowPointMarks="False"></telerik:SplineSeriesDefinition>
            </telerik:SeriesMapping.SeriesDefinition>
            <telerik:SeriesMapping.ItemMappings>
                <telerik:ItemMapping DataPointMember="XValue" FieldName="XValue" />
                <telerik:ItemMapping DataPointMember="YValue" FieldName="YValue1" />
            </telerik:SeriesMapping.ItemMappings>
        </telerik:SeriesMapping>
        <telerik:SeriesMapping LegendLabel="Avv" >
            <telerik:SeriesMapping.SeriesDefinition>
                <telerik:SplineSeriesDefinition ShowItemToolTips="True" ShowItemLabels="False" ShowPointMarks="False"></telerik:SplineSeriesDefinition>
            </telerik:SeriesMapping.SeriesDefinition>
            <telerik:SeriesMapping.ItemMappings>
                <telerik:ItemMapping DataPointMember="XValue" FieldName="XValue" />
                <telerik:ItemMapping DataPointMember="YValue" FieldName="YValue2" />
            </telerik:SeriesMapping.ItemMappings>
        </telerik:SeriesMapping>
        <telerik:SeriesMapping LegendLabel="Avv" >
            <telerik:SeriesMapping.SeriesDefinition>
                <telerik:SplineSeriesDefinition ShowItemToolTips="True" ShowItemLabels="False" ShowPointMarks="False"></telerik:SplineSeriesDefinition>
            </telerik:SeriesMapping.SeriesDefinition>
            <telerik:SeriesMapping.ItemMappings>
                <telerik:ItemMapping DataPointMember="XValue" FieldName="XValue" />
                <telerik:ItemMapping DataPointMember="YValue" FieldName="YValue3" />
            </telerik:SeriesMapping.ItemMappings>
        </telerik:SeriesMapping>
    </telerik:RadChart.SeriesMappings>
    <telerik:RadChart.DefaultView>
        <telerik:ChartDefaultView>
            <telerik:ChartDefaultView.ChartArea>
                <telerik:ChartArea PaletteBrushesRepeat="False" x:Name="chartArea"  >
                    <telerik:ChartArea.PaletteBrushes>
                        <SolidColorBrush Color="Red" />
                        <SolidColorBrush Color="Blue" />
                        <SolidColorBrush Color="Green" />
                    </telerik:ChartArea.PaletteBrushes>
                </telerik:ChartArea>
            </telerik:ChartDefaultView.ChartArea>
            <telerik:ChartDefaultView.ChartLegend>
                <telerik:ChartLegend Visibility="Hidden" Width="0" />
            </telerik:ChartDefaultView.ChartLegend>
        </telerik:ChartDefaultView>
    </telerik:RadChart.DefaultView>
</telerik:RadChart>

In code behind of this User Control I have this property:

public object SignalsItemsSource
{
    get { return radChart.ItemsSource; }
    set { radChart.ItemsSource = value; }
}

I set this property with 700 points that start on x from 0:

Dictionary<int, double> _dicY1 = new Dictionary<int, double>();
Dictionary<int, double> _dicY2 = new Dictionary<int, double>();
Dictionary<int, double> _dicY3 = new Dictionary<int, double>();
 
for (int _ii = 0; _ii < 700; _ii++)
{
    Random _random = new Random(DateTime.Now.Millisecond);
    _dicY1[_ii] = _random.NextDouble();
    _dicY2[_ii] = _random.NextDouble();
    _dicY3[_ii] = _random.NextDouble();
}
_itemSource = _dicY1.Keys.Select(_k => new { XValue = _k, YValue1 = _dicY1[_k], YValue2 = _dicY2[_k], YValue3 = _dicY3[_k] }).OrderBy(_v => _v.XValue);
 
_userControl.SignalsItemsSource = _itemSource;

I have the X-Axis start from negative value, it is possibile configure RadChart to start from 0 or min value of X-Axis?

Greetings,
Paolo​​

Dinko | Tech Support Engineer
Telerik team
 answered on 04 Nov 2015
4 answers
192 views

Hi,

 I have a chartview that is bound to the same data as a gridview. Each series corresponds to a different column. The usercontrol containing these filter data based on combobox values and then displays the resulting data in the chartview and gridview. For some filter combinations this works perfectly, but for others the chartview does not display correctly. Note on the attached screen capture the "spikes" in the graph and comparing them to the data in the gridview which is fine. As I have mentioned both are bound to the same observable collection in the view model from the same view (user control).

Here is the chartview section:

 

<telerik:RadCartesianChart x:Name="chartFromPort" Margin="5" >
    <telerik:RadCartesianChart.Behaviors>
        <telerik:ChartTooltipBehavior HorizontalOffset="-6" VerticalOffset="-49" />
    </telerik:RadCartesianChart.Behaviors>
    <telerik:RadCartesianChart.TooltipTemplate>
        <DataTemplate>
            <Grid>
                <Path Data="M-1236,-441 L-1180,-441 -1180,-424 -1228,-424 -1230.5,-420 -1233,-424 -1236,-424 z"
                      Stretch="Fill" Fill="White" Stroke="Gray" StrokeThickness="1" />
                <TextBlock Text="{Binding Value, StringFormat='N0'}" Margin="4,3,4,9" FontFamily="Segoe UI" />
            </Grid>
        </DataTemplate>
    </telerik:RadCartesianChart.TooltipTemplate>
    <telerik:RadCartesianChart.Resources>
        <DataTemplate x:Key="StrategyTemplate">
            <Ellipse Height="10" Width="10" Fill="Red" />
        </DataTemplate>
        <DataTemplate x:Key="TrafficFileTemplate">
            <Ellipse Height="10" Width="10" Fill="Blue" />
        </DataTemplate>
    </telerik:RadCartesianChart.Resources>
    <telerik:RadCartesianChart.HorizontalAxis>
        <telerik:CategoricalAxis LabelFitMode="Rotate" LabelRotationAngle="270" PlotMode="BetweenTicks" />
    </telerik:RadCartesianChart.HorizontalAxis>
    <telerik:RadCartesianChart.VerticalAxis>
        <telerik:LinearAxis Minimum="0" >
            <telerik:LinearAxis.LabelTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding Converter={StaticResource LabelFormatConverter}}"/>
                </DataTemplate>
            </telerik:LinearAxis.LabelTemplate>
        </telerik:LinearAxis>
    </telerik:RadCartesianChart.VerticalAxis>
    <telerik:RadCartesianChart.Series>
        <telerik:AreaSeries ItemsSource="{Binding MarketShareVolumesFromPort}"
                                CategoryBinding="Year"
                                ValueBinding="RailPotential"
                                CombineMode="Stack"
                                >
            <telerik:AreaSeries.LegendSettings>
                <telerik:SeriesLegendSettings Title="Rail Potential" />
            </telerik:AreaSeries.LegendSettings>
            <telerik:AreaSeries.AreaShapeStyle>
                <Style TargetType="Path">
                    <Setter Property="Fill" Value="#FFC3D69B"/>
                </Style>
            </telerik:AreaSeries.AreaShapeStyle>
        </telerik:AreaSeries>
 
        <telerik:AreaSeries ItemsSource="{Binding MarketShareVolumesFromPort}"
                                CategoryBinding="Year"
                                ValueBinding="Competitive"
                                CombineMode="Stack"
                                >
            <telerik:AreaSeries.LegendSettings>
                <telerik:SeriesLegendSettings Title="Competitive Potential" />
            </telerik:AreaSeries.LegendSettings>
            <telerik:AreaSeries.AreaShapeStyle>
                <Style TargetType="Path">
                    <Setter Property="Fill" Value="#FFFFC000"/>
                </Style>
            </telerik:AreaSeries.AreaShapeStyle>
        </telerik:AreaSeries>
 
        <telerik:AreaSeries ItemsSource="{Binding MarketShareVolumesFromPort}"
                                CategoryBinding="Year"
                                ValueBinding="RoadFriendly"
                                CombineMode="Stack"
                                >
            <telerik:AreaSeries.LegendSettings>
                <telerik:SeriesLegendSettings Title="Road Potential" />
            </telerik:AreaSeries.LegendSettings>
            <telerik:AreaSeries.AreaShapeStyle>
                <Style TargetType="Path">
                    <Setter Property="Fill" Value="#FFE6B9B8"/>
                </Style>
            </telerik:AreaSeries.AreaShapeStyle>
        </telerik:AreaSeries>
 
        <telerik:AreaSeries ItemsSource="{Binding MarketShareVolumesFromPort}"
                                CategoryBinding="Year"
                                ValueBinding="SmallParcelLimit"
                                CombineMode="Stack"
                                >
            <telerik:AreaSeries.LegendSettings>
                <telerik:SeriesLegendSettings Title="Small Parcels" />
            </telerik:AreaSeries.LegendSettings>
            <telerik:AreaSeries.AreaShapeStyle>
                <Style TargetType="Path">
                    <Setter Property="Fill" Value="#FF8EB4E3"/>
                </Style>
            </telerik:AreaSeries.AreaShapeStyle>
        </telerik:AreaSeries>
 
        <telerik:LineSeries ItemsSource="{Binding MarketShareVolumesFromPort}"
                                CategoryBinding="Year"
                                ValueBinding="RailStrategy"
                                CombineMode="None"
                                PointTemplate="{StaticResource StrategyTemplate}"
                                >
            <telerik:LineSeries.LegendSettings>
                <telerik:SeriesLegendSettings Title="Rail Strategy" MarkerGeometry="{StaticResource EllipseGeometry1}" />
            </telerik:LineSeries.LegendSettings>
            <telerik:LineSeries.StrokeShapeStyle>
                <Style TargetType="Path">
                    <Setter Property="Stroke" Value="Red"/>
                    <Setter Property="StrokeThickness" Value="2"/>
                </Style>
            </telerik:LineSeries.StrokeShapeStyle>
        </telerik:LineSeries>
 
        <telerik:LineSeries ItemsSource="{Binding MarketShareVolumesFromPort}"
                                CategoryBinding="Year"
                                ValueBinding="PlannedRail"
                                CombineMode="None"
                                PointTemplate="{StaticResource TrafficFileTemplate}"
                                >
            <telerik:LineSeries.LegendSettings>
                <telerik:SeriesLegendSettings Title="TrafficFile" MarkerGeometry="{StaticResource EllipseGeometry1}" />
            </telerik:LineSeries.LegendSettings>
            <telerik:LineSeries.StrokeShapeStyle>
                <Style TargetType="Path">
                    <Setter Property="Stroke" Value="Blue"/>
                    <Setter Property="StrokeThickness" Value="2"/>
                </Style>
            </telerik:LineSeries.StrokeShapeStyle>
        </telerik:LineSeries>
 
    </telerik:RadCartesianChart.Series>
</telerik:RadCartesianChart>

And here is the gridview section:

<telerik:RadGridView Margin="5"
                 RowIndicatorVisibility="Collapsed"
                 AutoGenerateColumns="False"
                 ShowGroupPanel="False"
                 ItemsSource="{Binding MarketShareVolumesFromPort}"
                 >
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn Header="Year"
                                DataMemberBinding="{Binding Year}"
                                Width="60"
                                IsFilterable="False"
                                IsSortable="False"
                                IsReadOnly="True"
                                HeaderTextAlignment="Center"
                                />
        <telerik:GridViewDataColumn Header="Small Parcels"
                                DataMemberBinding="{Binding SmallParcelLimit}"
                                Width="100"
                                IsFilterable="False"
                                IsSortable="False"
                                IsReadOnly="True"
                                DataFormatString="N2"
                                HeaderTextAlignment="Center"
                                TextAlignment="Right"
                                />
        <telerik:GridViewDataColumn Header="Road Potential"
                                DataMemberBinding="{Binding RoadFriendly}"
                                Width="100"
                                IsFilterable="False"
                                IsSortable="False"
                                IsReadOnly="True"
                                DataFormatString="N2"
                                HeaderTextAlignment="Center"
                                TextAlignment="Right"
                                />
        <telerik:GridViewDataColumn Header="Competitive Potential"
                                DataMemberBinding="{Binding Competitive}"
                                Width="100"
                                IsFilterable="False"
                                IsSortable="False"
                                IsReadOnly="True"
                                DataFormatString="N2"
                                HeaderTextAlignment="Center"
                                TextAlignment="Right"
                                />
        <telerik:GridViewDataColumn Header="Rail Potential"
                                DataMemberBinding="{Binding RailPotential}"
                                Width="100"
                                IsFilterable="False"
                                IsSortable="False"
                                IsReadOnly="True"
                                DataFormatString="N2"
                                HeaderTextAlignment="Center"
                                TextAlignment="Right"
                                />
        <telerik:GridViewDataColumn Header="Total Potential"
                                DataMemberBinding="{Binding TotalPotential}"
                                Width="100"
                                IsFilterable="False"
                                IsSortable="False"
                                IsReadOnly="True"
                                DataFormatString="N2"
                                HeaderTextAlignment="Center"
                                TextAlignment="Right"
                                />
        <telerik:GridViewDataColumn Header="Rail Strategy"
                                DataMemberBinding="{Binding RailStrategy}"
                                Width="100"
                                IsFilterable="False"
                                IsSortable="False"
                                IsReadOnly="True"
                                DataFormatString="N2"
                                HeaderTextAlignment="Center"
                                TextAlignment="Right"
                                />
        <telerik:GridViewDataColumn Header="Traffic File"
                                DataMemberBinding="{Binding PlannedRail}"
                                Width="100"
                                IsFilterable="False"
                                IsSortable="False"
                                IsReadOnly="True"
                                DataFormatString="N2"
                                HeaderTextAlignment="Center"
                                TextAlignment="Right"
                                />
        <telerik:GridViewDataColumn Header="Rail Addressable"
                                DataMemberBinding="{Binding RoadPotential}"
                                Width="100"
                                IsFilterable="False"
                                IsSortable="False"
                                IsReadOnly="True"
                                DataFormatString="N2"
                                HeaderTextAlignment="Center"
                                TextAlignment="Right"
                                />
    </telerik:RadGridView.Columns>
</telerik:RadGridView>

The business objects in the collection has the following definition: 

[Table("MarketShareDataVolumes")]
public partial class MarketShareDataVolume
{
    [Key]
    [DatabaseGenerated(DatabaseGeneratedOption.None)]
    public int MarketShareDataVolumeId { get; set; }
    public int MarketShareDataPointId { get; set; }
    public virtual MarketShareDataPoint MarketShareDataPoint { get; set; }
    public byte YearIndex { get; set; }
    public double? RailPotential { get; set; }
    public double? RoadPotential { get; set; }
    public double? NoLimit { get; set; }
    public double? SmallParcelLimit { get; set; }
    public double? PlannedRail { get; set; }
    public double? RailStrategy { get; set; }
    [NotMapped]
    public short? Year { get; private set; }
    [NotMapped]
    public double Competitive { get; private set; }
    [NotMapped]
    public double RoadFriendly { get; private set; }
    [NotMapped]
    public double TotalPotential { get; private set; }
 
    public void Initialise()
    {
        if (MarketShareDataPoint != null) Year = (short)(MarketShareDataPoint.MarketShareDataSet.BaseYear + YearIndex);
        Competitive = (RoadPotential ?? 0) - (RailPotential ?? 0);
        RoadFriendly = (NoLimit ?? 0) - (RoadPotential ?? 0);
        TotalPotential = (NoLimit ?? 0) + (SmallParcelLimit ?? 0);
    }
}

Initialise gets called on each object before it is added to the observable collection.

I would greatly appreciate any urgent assistance

Regards

Renier

 

 

Petar Marchev
Telerik team
 answered on 04 Nov 2015
9 answers
353 views
Hi, my problem is as follows; How can i bind the DisplayNames to my resources, so that language changes also effects them? using MVVM.
I can change the language of content in the property grid and everything around it with my CultureChangeEvent, but not the statically bound DisplayNames. Either I'd like them non-static or some way to update them as statics..
I have tried to get them in a non-static DataContext but failed, please help.

<telerik:RadPropertyGrid x:Name="SettingsPropertyGrid"
                         Item="{Binding Setting}"
                         SearchBoxVisibility="Collapsed"
                         SortAndGroupButtonsVisibility="Collapsed"
                         AutoGeneratePropertyDefinitions="False">
    <telerik:RadPropertyGrid.PropertyDefinitions>
        <telerik:PropertyDefinition Binding="{Binding Languages, Mode=TwoWay}"
                                    GroupName="Localization"
                                    DisplayName="{x:Static resx:SettingsModule_Resource.DisplayNameLanguage}"
                                    />
        <telerik:PropertyDefinition Binding="{Binding MeasurementUnit, Mode=TwoWay}"
                                    GroupName="Localization"
                                    DisplayName="{x:Static resx:SettingsModule_Resource.DisplayNameUnit}"
                                    />
        <telerik:PropertyDefinition Binding="{Binding DeviceId, Mode=TwoWay}"
                                    GroupName="Developer Settings"
                                    DisplayName="{x:Static resx:SettingsModule_Resource.DisplayNameDevice}"
                                    />
        <telerik:PropertyDefinition Binding="{Binding LogLevel, Mode=TwoWay}"
                                    GroupName="Developer Settings"
                                    DisplayName="{x:Static resx:SettingsModule_Resource.DisplayNameLog}"
                                    />
    </telerik:RadPropertyGrid.PropertyDefinitions>
</telerik:RadPropertyGrid>


Asked the question in an old post, I probably shouldn't have done that..

//Anders
Petya
Telerik team
 answered on 04 Nov 2015
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
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
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
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?