I use Remote Desktop Connection to connect another desktop
and run my program. in my program, I have a PanelBar.
I chose an item inside the PanelBarItem.
when I reconnect by RDC, suddenly selected item unselect.
I attached a project to show my problem:
https://www.mediafire.com/?2fg3d2240pe6dbt
Please help me.
Thanks.
Hello. I have the following XAML markup:
<
UserControl
x:Class
=
"UltrasonicSensors.Views.UltrasonicSensorsView"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
xmlns:prism
=
"http://prismlibrary.com/"
prism:ViewModelLocator.AutoWireViewModel
=
"True"
>
<
UserControl.Resources
>
<!--Spline series style-->
<
Style
x:Key
=
"SplineSeriesStyle"
TargetType
=
"telerik:SplineSeries"
>
<
Setter
Property
=
"Stroke"
Value
=
"RoyalBlue"
/>
<
Setter
Property
=
"StrokeThickness"
Value
=
"3"
/>
</
Style
>
<!--Content template of each RadTileViewItem-->
<
DataTemplate
x:Key
=
"ContentTemplate"
>
<
telerik:RadCartesianChart
x:Name
=
"chart1"
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Stretch"
EmptyContent
=
"{Binding ChartEmptyContent}"
>
<!--Turn scrollbar off-->
<
telerik:RadCartesianChart.Resources
>
<
Style
TargetType
=
"telerik:PanZoomBar"
>
<
Setter
Property
=
"Visibility"
Value
=
"Collapsed"
/>
</
Style
>
</
telerik:RadCartesianChart.Resources
>
<!-- X-axis -->
<
telerik:RadCartesianChart.HorizontalAxis
>
<
telerik:CategoricalAxis
LabelInterval
=
"6"
/>
</
telerik:RadCartesianChart.HorizontalAxis
>
<!-- Y-axis -->
<
telerik:RadCartesianChart.VerticalAxis
>
<
telerik:LinearAxis
Minimum
=
"-128"
Maximum
=
"127"
MajorStep
=
"8"
/>
</
telerik:RadCartesianChart.VerticalAxis
>
<!--Spline series itself-->
<
telerik:SplineSeries
CategoryBinding
=
"Item1"
ValueBinding
=
"Item2"
ItemsSource
=
"{Binding SensorData}"
Style
=
"{StaticResource SplineSeriesStyle}"
/>
<!--Layout grid-->
<
telerik:RadCartesianChart.Grid
>
<
telerik:CartesianChartGrid
MajorLinesVisibility
=
"XY"
StripLinesVisibility
=
"XY"
IsTabStop
=
"False"
>
<
telerik:CartesianChartGrid.YStripeBrushes
>
<
SolidColorBrush
Color
=
"#FFD7D7D7"
Opacity
=
"0.3"
/>
<
SolidColorBrush
Color
=
"Transparent"
/>
</
telerik:CartesianChartGrid.YStripeBrushes
>
<
telerik:CartesianChartGrid.XStripeBrushes
>
<
SolidColorBrush
Color
=
"#FFD7D7D7"
Opacity
=
"0.3"
/>
<
SolidColorBrush
Color
=
"Transparent"
/>
</
telerik:CartesianChartGrid.XStripeBrushes
>
</
telerik:CartesianChartGrid
>
</
telerik:RadCartesianChart.Grid
>
<!--Panning and zooming-->
<
telerik:RadCartesianChart.Behaviors
>
<
telerik:ChartPanAndZoomBehavior
DragMode
=
"Pan"
ZoomMode
=
"Both"
PanMode
=
"Both"
/>
</
telerik:RadCartesianChart.Behaviors
>
</
telerik:RadCartesianChart
>
</
DataTemplate
>
</
UserControl.Resources
>
<
Grid
>
<!--Ultrasonic sensors signals charts:-->
<
telerik:RadTileView
Grid.Row
=
"0"
Grid.Column
=
"0"
PreservePositionWhenMaximized
=
"True"
MinimizedColumnWidth
=
"150"
ItemsSource
=
"{Binding SensorSignalCharts}"
DisplayMemberPath
=
"ChartCaption"
ContentTemplate
=
"{StaticResource ContentTemplate}"
>
</
telerik:RadTileView
>
</
Grid
>
</
UserControl
>
For the RadCartesianChart above I have the following ViewModel:
using Prism.Mvvm;
using System;
using Telerik.Windows.Data;
namespace UltrasonicSensors.ViewModels
{
/// <
summary
>
/// Ultrasonic sensor signal ViewModel.
/// </
summary
>
public class SensorSignalChartViewModel : BindableBase
{
#region Fields
/// <
summary
>
/// Ultrasonic sensor signal chart point collection.
/// </
summary
>
private RadObservableCollection<
Tuple
<int, double>> _sensorData;
/// <
summary
>
/// Data missing Message.
/// </
summary
>
private object _chartEmptyContent;
/// <
summary
>
/// Chart header.
/// </
summary
>
private string _caption;
#endregion
#region Constructors
/// <
summary
>
/// Create instance of SensorSignalViewModel.
/// </
summary
>
/// <
param
name
=
"aSensorData"
>Ultrasonic sensor signal chart point collection.</
param
>
public SensorSignalChartViewModel(Tuple<
int
, double>[] aSensorData)
{
this.SensorData = new RadObservableCollection<
Tuple
<int, double>>(aSensorData);
}
#endregion
#region Properties
/// <
summary
>
/// Gets or sets ultrasonic sensor signal chart point collection.
/// </
summary
>
public RadObservableCollection<
Tuple
<int, double>> SensorData
{
get { return this._sensorData; }
set { this.SetProperty(ref this._sensorData, value); }
}
/// <
summary
>
/// Gets or sets data missing message.
/// </
summary
>
public object ChartEmptyContent
{
get { return this._chartEmptyContent; }
set { this.SetProperty(ref this._chartEmptyContent, value); }
}
/// <
summary
>
/// Gets or sets chart header.
/// </
summary
>
public string ChartCaption
{
get { return this._caption; }
set { this.SetProperty(ref this._caption, value); }
}
#endregion
}
}
As you can see above, RadCartesianChart in "ContentTemplate" DataTemplate is bound to this ViewModel. And there is another ViewModel called UltrasonicSensorsViewModel which contain RadObservableCollection of SensorSignalChartViewModel. Please see it below:
/// <
summary
>
/// ViewModel of charts of ultrasonic sensors signals.
/// </
summary
>
public class UltrasonicSensorsViewModel : BindableBase, IConfirmNavigationRequest
{
#region Fields
#region Constant Fields
/// <
summary
>
/// Data missing message.
/// </
summary
>
private const string NO_DATA_FOR_CHART = "Нет данных для построения графика";
/// <
summary
>
/// Number of points in each signal chart.
/// </
summary
>
private const int CHART_POINTS_QUANTITY = 180;
#endregion
#region Common Variable Fields
/// <
summary
>
/// Ultrasonic sensors quantity.
/// </
summary
>
private int _sensorsQuantity;
/// <
summary
>
/// Collection of sensorSignalChartViewModel instances.
/// </
summary
>
private RadObservableCollection<
SensorSignalChartViewModel
> _sensorSignalCharts;
/// <
summary
>
/// Sensors polling timer.
/// </
summary
>
private Timer _sensorsPollingTimer;
/// <
summary
>
/// Timer period in millisecond.
/// </
summary
>
private long _pollingPeriod = 500;
#endregion
#endregion
#region Constructors
public UltrasonicSensorsViewModel()
{
// This is dummy data to simulate (imitate) each chart.
byte[] aDummyData = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
0x01, 0x00, 0x00, 0xFE, 0xFE, 0xFF, 0x00, 0x01, 0x03, 0x02, 0x01, 0x00, 0xFD, 0xFC, 0xFD, 0x00, 0x04, 0x06, 0x07, 0x03, 0xFD, 0xF7, 0xF3, 0xF6,
0x00, 0x0B, 0x14, 0x15, 0x0C, 0xFC, 0xEA, 0xDF, 0xE2, 0xF4, 0x0E, 0x26, 0x2F, 0x24, 0x07, 0xE4, 0xCA, 0xC6, 0xDB, 0x01, 0x2B, 0x44, 0x41, 0x22,
0xF3, 0xC8, 0xB4, 0xBF, 0xE6, 0x18, 0x41, 0x4E, 0x3B, 0x10, 0xE0, 0xBE, 0xB8, 0xCF, 0xF9, 0x23, 0x3E, 0x3E, 0x26, 0x01, 0xDF, 0xCD, 0xCF, 0xE5,
0x01, 0x1A, 0x27, 0x23, 0x13, 0x00, 0xEF, 0xE7, 0xE9, 0xF2, 0xFE, 0x08, 0x0D, 0x0E, 0x0B, 0x06, 0x01, 0xFD, 0xF9, 0xF6, 0xF6, 0xF8, 0xFD, 0x03,
0x0A, 0x0E, 0x0D, 0x07, 0xFF, 0xF5, 0xF0, 0xF0, 0xF7, 0x00, 0x0A, 0x10, 0x0E, 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
this.SensorSignalCharts = new RadObservableCollection<
SensorSignalChartViewModel
>();
Tuple<
int
, double>[] aSensorData = new Tuple<
int
, double>[CHART_POINTS_QUANTITY];
// Create array of chart data (i==X, aDummyData[i] == Y)
for (int i = 0; i <
aDummyData.Length
; i++)
aSensorData[i] = new Tuple<int, double>(i, aDummyData[i]);
// Create eight (8) RadTileViewItems. The content of each RadTileViewItem is a chart with simulating data
SensorSignalChartViewModel sscm = new SensorSignalChartViewModel(aSensorData);
sscm.ChartCaption = "График сигнала от первого сенсора";
sscm.ChartEmptyContent = NO_DATA_FOR_CHART;
this.SensorSignalCharts.Add(sscm);
sscm = new SensorSignalChartViewModel(aSensorData);
sscm.ChartCaption = "График сигнала от второго сенсора";
sscm.ChartEmptyContent = NO_DATA_FOR_CHART;
this.SensorSignalCharts.Add(sscm);
sscm = new SensorSignalChartViewModel(aSensorData);
sscm.ChartCaption = "График сигнала от третьего сенсора";
sscm.ChartEmptyContent = NO_DATA_FOR_CHART;
this.SensorSignalCharts.Add(sscm);
sscm = new SensorSignalChartViewModel(aSensorData);
sscm.ChartCaption = "График сигнала от четвёртого сенсора";
sscm.ChartEmptyContent = NO_DATA_FOR_CHART;
this.SensorSignalCharts.Add(sscm);
sscm = new SensorSignalChartViewModel(aSensorData);
sscm.ChartCaption = "График сигнала от пятого сенсора";
sscm.ChartEmptyContent = NO_DATA_FOR_CHART;
this.SensorSignalCharts.Add(sscm);
sscm = new SensorSignalChartViewModel(aSensorData);
sscm.ChartCaption = "График сигнала от шестого сенсора";
sscm.ChartEmptyContent = NO_DATA_FOR_CHART;
this.SensorSignalCharts.Add(sscm);
sscm = new SensorSignalChartViewModel(aSensorData);
sscm.ChartCaption = "График сигнала от седьмого сенсора";
sscm.ChartEmptyContent = NO_DATA_FOR_CHART;
this.SensorSignalCharts.Add(sscm);
sscm = new SensorSignalChartViewModel(aSensorData);
sscm.ChartCaption = "График сигнала от восмого сенсора";
sscm.ChartEmptyContent = NO_DATA_FOR_CHART;
this.SensorSignalCharts.Add(sscm);
// Create timer but don't start yet.
this._sensorsPollingTimer = new Timer(this.sensorsPollingTimerCallback, null, -1, this._pollingPeriod);
}
#endregion
#region Properties
/// <
summary
>
/// Gets or sets collection of SensorSignalChartViewModel instances.
/// </
summary
>
public RadObservableCollection<
SensorSignalChartViewModel
> SensorSignalCharts
{
get { return this._sensorSignalCharts; }
set { this.SetProperty(ref this._sensorSignalCharts, value); }
}
#endregion
#region Methods
/// <
summary
>
/// Timer tick handler.
/// </
summary
>
/// <
param
name
=
"state"
></
param
>
private void sensorsPollingTimerCallback(object state)
{
}
#endregion
#region IConfirmNavigationRequest Implementation
void IConfirmNavigationRequest.ConfirmNavigationRequest(NavigationContext navigationContext, Action<
bool
> continuationCallback)
{
continuationCallback(true);
}
bool INavigationAware.IsNavigationTarget(NavigationContext navigationContext)
{
return true;
}
void INavigationAware.OnNavigatedFrom(NavigationContext navigationContext)
{
;
}
void INavigationAware.OnNavigatedTo(NavigationContext navigationContext)
{
;
}
#endregion
}
When I run my program I see no charts as you can see in EmptyCharts.PNG file attached. Why I see no charts? Please help me.
Hi
I'm trying to data-bind the IsPinned-property of the GridViewRow to a value from my model.
After numerous unsuccessful tries, I tried setting the IsPinned property to true through a style (see below).
However, the row is not pinned, also the button does not reflect the Pinned state.
How can I set the IsPinned-property through a property of my model?
01.
<
telerik:RadGridView
Grid.Row
=
"2"
ItemsSource
=
"{Binding Path=CalculablePersons}"
GroupRenderMode
=
"Flat"
PinnedRowsPosition
=
"Top"
>
02.
<
telerik:RadGridView.Resources
>
03.
<
Style
TargetType
=
"{x:Type telerik:GridViewRow}"
BasedOn
=
"{StaticResource {x:Type telerik:GridViewRow}}"
>
04.
<
Setter
Property
=
"IsPinned"
Value
=
"True"
/>
05.
</
Style
>
06.
</
telerik:RadGridView.Resources
>
07.
08.
<
telerik:RadGridView.Columns
>
09.
<
telerik:GridViewPinRowColumn
/>
10.
<
telerik:GridViewDataColumn
Header
=
"Name"
DataMemberBinding
=
"{Binding Path=Name}"
/>
11.
</
telerik:RadGridView.Columns
>
12.
</
telerik:RadGridView
>
hello,
I want to present multiple legends on radMap, each legend item I want to present is actually a userControl that I build and it contains spectrum, numbers and some other buttons and options.
my final result is to have the map layer and above it a layer in witch allow the user drag and drop the legends all over the map (in order to place them wherever he wants)
so basically i need a layer that:
1. transparent
2. I want it not to block the layer below it
3. I want it to allow drag and drop
attached a png to show what i mean
I'm trying to use itemsControl in information layer in order to bind MapLeged to it but no success.. nothing presented on the map
this is my code in generally:
<telerik:RadMap>
<telerik:InformationLayer x:Name="informationLayer">
<ItemsControl itemsSource= " {Binding LayersProvider.Layers} "
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate......./>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<contentControl content={Binding LegendContext}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</telerik:InformationLayer>
<telerik:VisualizationLayer......................./>
</telerik:RadMap>
<telerik:MapLegend x:Name="mapLegend"
Layer="{Binding informationLayer}" />
maybe you will have an idea for me.
thank you so match
stav
Hi Telerik,
We are facing two issues when we are using Stepline series.
ISSUE 1 :
When there is only one category / data point then chart is not drawing . We have such cases and we need solution or workaround for this case
<
telerik:StepLineSeries
>
<
telerik:StepLineSeries.DataPoints
>
<
telerik:CategoricalDataPoint
Category
=
"1"
Value
=
"1.0"
/>
<!--<
telerik:CategoricalDataPoint
Category
=
"2"
Value
=
1
.1" />
<
telerik:CategoricalDataPoint
Category
=
"3"
Value
=
"1.0"
/>
<
telerik:CategoricalDataPoint
Category
=
"4"
Value
=
"1.1"
/>-->
</
telerik:StepLineSeries.DataPoints
>
</
telerik:StepLineSeries
>
ISSUE 2 :
We are using marked zone but marking falling in between and not from beginning so we used margin workaround from telerik to fix (Please see code from attached xaml.cs file)
Before Shifting
See image
After Shifting
See image
BELOW CODE USED TO ALIGN MARGIN
int categoriesCount = this.horizontalAxis.Categories.Count();
double categorySlotSize = this.chart.PlotAreaClip.Width * this.chart.Zoom.Width / categoriesCount;
var margin = new Thickness(-(categorySlotSize / 2), 0, 0, 0);
if (!margin.ToString().Contains("Infinity"))
{
this.chart.Annotations.Where(x => x is CartesianMarkedZoneAnnotation).ToList()
.ForEach(m => { m.Margin = margin; });
}
But we are facing issue when we zoom the chart.The marking going out of actual area.Please help to resolve it.
After Zooming
See Image
ISSUE 3 :
When we are using marking for last category then the marking done for half way only.Please help to draw until end (Need to support while zooming as well)
<
telerik:StepLineSeries
>
<
telerik:StepLineSeries.DataPoints
>
<
telerik:CategoricalDataPoint
Category
=
"1"
Value
=
"1.0"
/>
<
telerik:CategoricalDataPoint
Category
=
"2"
Value
=
"1.1"
/>
<
telerik:CategoricalDataPoint
Category
=
"3"
Value
=
"1.0"
/>
<
telerik:CategoricalDataPoint
Category
=
"4"
Value
=
"1.1"
/>
</
telerik:StepLineSeries.DataPoints
>
</
telerik:StepLineSeries
>
<
telerik:CartesianMarkedZoneAnnotation
VerticalFrom
=
"1.0"
VerticalTo
=
"1.1"
HorizontalFrom
=
"4"
Fill
=
"Red"
/>
<
teler
Hi Telerik,
I am using stepline series with compination of Marked Zone to higlight certain horizontal/vertical area.The problem i am facing is marking on stepline not exactly sitting on specific category of stepline.As per below sample It starting from half 1 and ending 2 but in the result appear as starting from 0.5 to 1.5.Please see attached for accurate view.
Pelase help me on this.
ik:RadCartesianChart
x:Name
=
"chart1"
Grid.Row
=
"2"
Grid.Column
=
"1"
>
<
telerik:RadCartesianChart.VerticalAxis
>
<
telerik:LinearAxis
/>
</
telerik:RadCartesianChart.VerticalAxis
>
<
telerik:RadCartesianChart.HorizontalAxis
>
<
telerik:CategoricalAxis
IsInverse
=
"False"
VerticalLocation
=
"Top"
/>
</
telerik:RadCartesianChart.HorizontalAxis
>
<!--<
telerik:RangeBarSeries
>
<
telerik:RangeBarSeries.DataPoints
>
<
telerik:RangeDataPoint
Category
=
"1"
High
=
"2.1"
Low
=
"2.0"
/>
<
telerik:RangeDataPoint
Category
=
"2"
High
=
"0"
Low
=
"0"
/>
<
telerik:RangeDataPoint
Category
=
"3"
High
=
"2.1"
Low
=
"2.0"
/>
<
telerik:RangeDataPoint
Category
=
"4"
High
=
"0"
Low
=
"0"
/>
</
telerik:RangeBarSeries.DataPoints
>
</
telerik:RangeBarSeries
>-->
<
telerik:StepLineSeries
>
<
telerik:StepLineSeries.DataPoints
>
<
telerik:CategoricalDataPoint
Category
=
"1"
Value
=
"2.0"
/>
<
telerik:CategoricalDataPoint
Category
=
"2"
Value
=
"2.1"
/>
<
telerik:CategoricalDataPoint
Category
=
"3"
Value
=
"2.0"
/>
<
telerik:CategoricalDataPoint
Category
=
"4"
Value
=
"2.1"
/>
</
telerik:StepLineSeries.DataPoints
>
</
telerik:StepLineSeries
>
<
telerik:RadCartesianChart.Annotations
>
<
telerik:CartesianMarkedZoneAnnotation
VerticalFrom
=
"2.0"
VerticalTo
=
"2.1"
HorizontalFrom
=
"1"
HorizontalTo
=
"2"
Fill
=
"Red"
/>
</
telerik:RadCartesianChart.Annotations
>
<!--<
telerik:RadCartesianChart.Grid
>
<
telerik:CartesianChartGrid
MajorLinesVisibility
=
"XY"
/>
</
telerik:RadCartesianChart.Grid
>-->
</
telerik:RadCartesianChart
>
Hi,
I'm trying to use your cartesian 3D chart, I need to show a chart but with a line presentation (instead of surface or bar or point).
is that possible?
I'm attaching a screenshot of my needs with other 3d view component so maybe you can understand better what i'm talking about.
Hi,
I have the license for version 2011.1.405.40. And in this version, i am getting the Animation exception whenever i move the mouse over the timebar control. Apparently it is trying to access Hand property of Cursor and it is unable to animate it over the Border control. Following is my code:
<
telerik:RadTimeBar
x:Name
=
"timeBar"
Width
=
"950"
Height
=
"250"
PeriodStart
=
"01-01-2011"
PeriodEnd
=
"01/01/2012"
VisiblePeriodStart
=
"01/01/2011"
VisiblePeriodEnd
=
"06/01/2011"
SelectionStart
=
"02/01/2011"
SelectionEnd
=
"03/01/2011"
MinSelectionRange
=
"28.00:00:00"
MaxSelectionRange
=
"31.00:00:00"
IsSnapToIntervalEnabled
=
"True"
>
<
telerik:RadTimeBar.Intervals
>
<
telerik:YearInterval
/>
<
telerik:MonthInterval
/>
<
telerik:WeekInterval
/>
<
telerik:DayInterval
/>
<
telerik:MinuteInterval
IntervalSpans
=
"1,10,15,30"
/>
<
telerik:SecondInterval
IntervalSpans
=
"10,15,30"
/>
</
telerik:RadTimeBar.Intervals
>
</
telerik:RadTimeBar
>
I have attached the image of exception as well. The newer version does not have this bug, but I cannot upgrade due to compatibility issues. I hope that there is a fix for this, disabling the animation or something like that.
Waiting for your early response. Thanks!