Telerik Forums
UI for WPF Forum
3 answers
713 views
Is there any way to set the PieChart slice colors from code behind?  I know how to do it with other chart styles (i.e. for line charts .. I use <series>.Definition.Appearance.Stroke/Fill).  But when you use that same idea for pie charts, all the slices are the same color.  Which I expect since I've only got one series.

            var series = new DataSeries { Definition = new PieSeriesDefinition() };
            series.Definition.ShowItemLabels = true;
            series.Add(new DataPoint(_dataList.A, _dataList.A));
            series.Add(new DataPoint(_dataList.B, _dataList.B));

            //series[0].LegendLabel = "Series A";
            //series[1].LegendLabel = "Series B";

            // this is what I do in other charts for each series... but pie charts don't work.
            //series.Definition.Appearance.Stroke = new SolidColorBrush(Colors.Black);
            //series.Definition.Appearance.Fill = new SolidColorBrush(myCustomColor);

            RadChart1.DefaultView.ChartArea.DataSeries.Add(series);

If I change the theme colours in XAML using the StylesPalette, the colors change.  But I really want to change them from code (dynamic when a user control starts up only, not necessarily dynamic while the app is running).   Any ideas?  Could the color of of the Fill property in the Xaml be changed using binding?

            <SolidColorBrush x:Key="RadialItemStroke" Color="#FF000000"/>
            <system:Double x:Key="RadialItemStrokeThickness">2</system:Double>
            <telerikStyling:StylesPalette x:Key="{telerikStyling:ThemeResourceKey
                    ThemeType={x:Type telerikStyling:Office_BlackTheme},
                    ElementType={x:Type telerikStyling:ChartArea},
                    ResourceId={x:Static telerikStyling:ResourceHelper.ResourceKeyRadialStyle}}">
                <Style TargetType="{x:Type Shape}">
                    <Setter Property="Stroke" Value="{StaticResource RadialItemStroke}" />
                    <Setter Property="StrokeThickness" Value="{StaticResource RadialItemStrokeThickness}" />
                    <Setter Property="Fill" Value="{Insert some binding expression here?}" />
                </Style>
                <Style TargetType="{x:Type Shape}">
                    <Setter Property="Stroke" Value="{StaticResource RadialItemStroke}" />
                    <Setter Property="StrokeThickness" Value="{StaticResource RadialItemStrokeThickness}" />
                    <Setter Property="Fill" Value="{Insert some binding expression here?}" />
                </Style>
            </telerikStyling:StylesPalette>

Thanks
Greg
Martin Ivanov
Telerik team
 answered on 23 Jun 2017
2 answers
102 views

Hi,
Can I rotate a group of some RadDiagramShape?

My problem is when I put beside more shapes and I group theme. Afterthat I would rotate a group to 90°

 

Dario Concilio
Top achievements
Rank 2
 answered on 23 Jun 2017
1 answer
160 views

I have multiple charts that share the same x-axis and have the trackballs grouped using chartviewutilities.cs from one of your examples. Everything works as expected when there is no zoom. However as soon as I throw a grouped zoom and pan into the mix the trackballs get out of sync. The further I zoom the more out of sync they become. How can i resolve this? 

Here is my charts xaml:

   <telerik:RadCartesianChart Margin="0,17,0,5" TrackBallInfoStyle="{StaticResource trackBallInfoStyle}" TrackBallLineStyle="{StaticResource trackBallLineStyle}" utils:ChartViewUtilities.ChartAlignmentGroup="g1" UseLayoutRounding="True" FontFamily="{DynamicResource FontFamilyRoboto}" Zoom="{Binding Zoom, Mode=TwoWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type View:MainWindow}}}" PanOffset="{Binding PanOffset, Mode=TwoWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type View:MainWindow}}}" MaxZoom="10000,10000">
            <telerik:RadCartesianChart.HorizontalAxis>
                <telerik:CategoricalAxis SmartLabelsMode="SmartStep" Title="Strip Length (meters)" MajorTickStyle="{StaticResource tickStyle}"/>
            </telerik:RadCartesianChart.HorizontalAxis>
            <telerik:RadCartesianChart.VerticalAxis>
                <telerik:LinearAxis SmartLabelsMode="SmartStepAndRange" MajorTickStyle="{StaticResource tickStyle}"/>
            </telerik:RadCartesianChart.VerticalAxis>
            <telerik:RadCartesianChart.Grid>
                <telerik:CartesianChartGrid MajorLinesVisibility="Y" MajorYLineDashArray="3,4"/>
            </telerik:RadCartesianChart.Grid>
            <telerik:RadCartesianChart.Behaviors>
                <telerik:ChartPanAndZoomBehavior ZoomMode="Horizontal" PanMode="Horizontal" />
                <telerik:ChartTrackBallBehavior ShowIntersectionPoints="True" 
                                                    utils:ChartViewUtilities.ShouldPositionTrackBallCloseToDataPoint="False"
                                                    utils:ChartViewUtilities.TrackBallGroup="g1" TrackInfoUpdated="ChartTrackBallBehavior_TrackInfoUpdated"/>
            </telerik:RadCartesianChart.Behaviors>
            <telerik:LineSeries x:Name="SteelDNALineSeries" CategoryBinding="Position" 
                                        ValueBinding="Value" 
                                        ItemsSource="{Binding Trace, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:ParameterTraceControl}}}"
                                        TrackBallTemplate="{StaticResource SteelDNATrackBallTemplate}" Stroke="{Binding RandomColor, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type View:MainWindow}}}" StrokeThickness="1"
                                        utils:ChartAnimationUtilities.CartesianAnimation="Rise"/>
        </telerik:RadCartesianChart>

 

and attached are what happens...

Martin Ivanov
Telerik team
 answered on 23 Jun 2017
7 answers
138 views
Hello,
After using ScaleTransform to scale up the UI of our application the Compass and VisualCue elements are clipped to, what seems to be, the unscaled size of the RadDocking control.

I am scaling the application by adding
<Grid.LayoutTransform>
            <ScaleTransform ScaleX="1.5" ScaleY="1.5" />
</Grid.LayoutTransform>

to the root element of the main window and setting the compass and visualcue scaling with
<telerikDocking:RadDocking.CompassStyle>
    <Style TargetType="telerik:Compass">
        <Setter Property="LayoutTransform">
            <Setter.Value>
                <ScaleTransform ScaleX="1.5" ScaleY="1.5"/>
            </Setter.Value>
        </Setter>
    </Style>
</telerikDocking:RadDocking.CompassStyle>
<telerikDocking:RadDocking.RootCompassStyle>
    <Style TargetType="telerik:RootCompass">
        <Setter Property="LayoutTransform">
            <Setter.Value>
                <ScaleTransform ScaleX="1.5" ScaleY="1.5" />
            </Setter.Value>
        </Setter>
    </Style>
</telerikDocking:RadDocking.RootCompassStyle>
<telerikDocking:RadDocking.VisualCueStyle>
    <Style TargetType="telerik:VisualCue">
        <Setter Property="LayoutTransform">
            <Setter.Value>
                <ScaleTransform ScaleX="1.5" ScaleY="1.5" />
            </Setter.Value>
        </Setter>
    </Style>
</telerikDocking:RadDocking.VisualCueStyle>

You can see the result in the attached image.
Are there other elements of the RadDocking control which I didn't set the scaling for, or am I approaching the whole scaling the wrong way ?
Stefan
Telerik team
 answered on 22 Jun 2017
3 answers
335 views

Hi,

I have a LocalDataSourceProvider bound to a DataTable. Some of the columns allow nulls and some of the values in them are DBNull. I would like to be able to display a count of the values that aren't null. I've created my own aggregate function and I can add that to some of my AggregatePropertyDescriptions programmatically. I do have an example, but apparently I'm only allowed to upload images.

The questions I've got are:

Is there any easier way to do this?

Can I make this aggregate function appear in the UI in the Field List, so users can select it?

I only appear to be able to apply this to my nullable int property, and not my string property. Is that something I should be expecting?

Many thanks,

Richard

Grinden
Top achievements
Rank 1
 answered on 22 Jun 2017
2 answers
176 views

Hi, I got the code from http://docs.telerik.com/devtools/wpf/controls/radgridview/columns/how-to/scroll-item

 

My code :

when DropRowIndex = 16 and the items.count=17 , it calls the scrollFailedCallback , I tried to make it this.timetableGrid.Items[this.timetableGrid.Items.Count -1] and it still fails. WHy? My items count is 17 so it should not be failing. I hardcoded it into DropRowIndex = 15 and it is calling scrollFinishedCallback which is what I want to happen. May I ask why rowindex 16 is not working ?

if (this.timetableGrid.Columns.Count > 0 && DropColIndex <= this.timetableGrid.Columns.Count)
            {
                IsScrollBarForceIntoView = false;
                int offsetCol = 0; int offsetRow = 0;
                if ((DropColIndex + 3) <= (this.timetableGrid.Columns.Count - 1))
                    offsetCol = 3;
                if ((DropRowindex + 3) <= (this.timetableGrid.Items.Count - 1))
                    offsetRow = 3;
                this.timetableGrid.ScrollIntoViewAsync(this.timetableGrid.Items[DropRowindex + offsetRow], //the row
                                this.timetableGrid.Columns[DropColIndex + offsetCol], //the column
                                 new Action<FrameworkElement>((f) =>
                                  {
                                      App.MainWindow.IsBusy = false;
                                  }), new Action ( ()=>
                                      {
                                          App.MainWindow.IsBusy = false;
                                      }
                                    ));
                isDrop = false;
            }
            else
            {
                App.MainWindow.IsBusy = false;
                DropColIndex = 0;
            }

Ivan Ivanov
Telerik team
 answered on 22 Jun 2017
1 answer
116 views

I used all resource string files for RadPivotGrid, but the message "Blank" could not find the key for translation. What is the procedure for translating this message?

I have a test project demonstrating the problem but I am not allowed to post

Martin Ivanov
Telerik team
 answered on 21 Jun 2017
3 answers
144 views
Hi,

are there any telerik graficle control templates for Storyboarding with VS 2012 in Powerpoint evailable or sceduled?

reagards
Dilyan Traykov
Telerik team
 answered on 21 Jun 2017
1 answer
166 views

Hi,

I'm using the Q3 2016 version of the Telerik WPF controls suite.  I'm having a problem using a ScatterLineSeries in tandem with the "Batch" option on XamlRenderOptions for the series.  I'm using a ChartSeriesDescriptor with a style for the ScatterLineSeries that has the following:

 

<Setter Property="DefaultVisualStyle" Value="{StaticResource DefaultVisualStyle}"/>
<Setter Property="RenderOptions">
    <Setter.Value>
        <telerik:XamlRenderOptions DefaultVisualsRenderMode="Batch"/>
    </Setter.Value>
</Setter>

 

That "DefaultVisualStyle" resource is defined like so:

 

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

 

When I use those options and add data points via bindings from the ChartSeriesProvider, I get a MissingMethodException, that seems to come from the UIAutomation system:

 

System.MissingMethodException: Constructor on type 'Telerik.Windows.Automation.Peers.ScatterPointAutomationPeer' not found.
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateInstance(Type type, Object[] args)
   at Telerik.Windows.Automation.Peers.ChartSeriesAutomationPeer.<>c__DisplayClass1.<EnumerateDataPointPeers>b__0()
   at Telerik.Windows.Automation.Peers.ChartElementAutomationPeer.GetOrCreatePeerForElement(DependencyObject target, Func`1 createPeer)
   at Telerik.Windows.Automation.Peers.ChartSeriesAutomationPeer.<EnumerateDataPointPeers>d__3.MoveNext()
   at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
   at Telerik.Windows.Automation.Peers.ScatterLineSeriesAutomationPeer.GetChildrenCore()
   at System.Windows.Automation.Peers.AutomationPeer.EnsureChildren()
   at System.Windows.Automation.Peers.AutomationPeer.UpdateChildrenInternal(Int32 invalidateLimit)
   at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   at System.Windows.ContextLayoutManager.fireAutomationEvents()
   at System.Windows.ContextLayoutManager.UpdateLayout()
   at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
   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)

 

Is there anything I can do to use Batch for performance on this series?

Martin Ivanov
Telerik team
 answered on 21 Jun 2017
1 answer
79 views
I try to open a contextmenu when i select many tasks/items in my ganttview, but when i click the right button, ganttview lost selecteditems and get just the item under my click.
How can i perform a contextmenu for two or many tasks?
Thank you
Stefan
Telerik team
 answered on 21 Jun 2017
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
Slider
Expander
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
WebCam
CardView
DataBar
Licensing
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
HighlightTextBlock
Security
TouchManager
StepProgressBar
VirtualKeyboard
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?