<Grid> <Grid.RowDefinitions> <RowDefinition Height="*"/> </Grid.RowDefinitions> <Grid.Resources><HierarchicalDataTemplate x:Key="NodeTemplate" ItemsSource="{Binding SubNodes}"> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Name}"/> </StackPanel> </HierarchicalDataTemplate> </Grid.Resources><telerik:RadTreeView Name="uxRadTreeView" ItemsSource="{Binding RootFolder.SubNodes}" ItemTemplate="{StaticResource NodeTemplate}" AllowDrop="False" IsDragDropEnabled="True" DragEnded="uxRadTreeView_DragEnded" MouseRightButtonUp="uxRadTreeView_MouseRightButtonUp"> <telerik:RadContextMenu.ContextMenu> <telerik:RadContextMenu IsEnabled="{Binding MainTree.CurrentItem.IsFolder, Mode=OneWay}" > <telerik:RadMenuItem Header="Create new folder" Icon="/GuiResources;component/ActionsIcons/newFolder.png" Click="NewFolder" /> <telerik:RadMenuItem Header="Create new file" Icon="/GuiResources;component/ActionsIcons/newFile.png" Click="NewFile"/> <telerik:RadMenuItem Header="Add a new version of this file" Icon="/GuiResources;component/ActionsIcons/newFileVersion.png" Click="NewFileVersion"/> <telerik:RadMenuItem Header="Delete" Icon="/GuiResources;component/ActionsIcons/delete.png" Click="Delete"/> </telerik:RadContextMenu> </telerik:RadContextMenu.ContextMenu> </telerik:RadTreeView> </Grid><
UserControl x:Class="TabControl.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerikChart="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:telerikCharting="clr-namespace:Telerik.Windows.Controls.Charting;assembly=Telerik.Windows.Controls.Charting"
Height="Auto" Width="Auto">
<Grid>
<Grid.Resources>
<Style x:Name="CustomAxisLineStyle" TargetType="Line">
<Setter Property="Stroke" Value="Red" />
<Setter Property="StrokeThickness" Value="5" />
</Style>
</Grid.Resources>
<telerikChart:RadChart x:Name="_myChart">
</telerikChart:RadChart>
</Grid>
</
UserControl>
private void GenerateSeries(string target, ref DateTime timeStamp, double avgVal, string counterName)
{
int _minsOffSet=0;
DateTime minDate = DateTime.MaxValue;
DateTime maxDate = DateTime.MinValue;
double minVal = double.MaxValue;
double maxVal = double.MinValue;
DataSeries counterSeries = new DataSeries();
counterSeries.Definition =
new LineSeriesDefinition() { ShowItemLabels = false, ShowItemToolTips = true };
counterSeries.Definition.ItemToolTipFormat =
"#SERIESLABEL\n#Y";
counterSeries.Definition.AxisName = counterName;
AxisY yAxis = new AxisY();
yAxis.AxisName = counterName;
string legendName = string.Format("{0}", counterName);
SetLegendDetails(legendName,
ref counterSeries, ref yAxis);
DateTime time = timeStamp.AddMinutes(_minsOffSet);
minVal =
Math.Min(minVal, avgVal);
maxVal =
Math.Max(maxVal, avgVal);
DataPoint dp = new DataPoint(time.ToOADate(), avgVal);
dp.IsDateTime =
true;
counterSeries.Add(dp);
if (time > maxDate)
maxDate = time;
if (time < minDate)
minDate = time;
if (avgVal > maxVal)
maxVal = avgVal;
if (avgVal > minVal)
minVal = avgVal;
_myChart.DefaultView.ChartArea.AxisX.MinValue = minDate.ToOADate();
_myChart.DefaultView.ChartArea.AxisX.MaxValue = maxDate.ToOADate();
_myChart.DefaultView.ChartArea.AxisY.MinValue = minVal;
_myChart.DefaultView.ChartArea.AxisY.MaxValue = maxVal;
_myChart.DefaultView.ChartArea.DataSeries.Add(counterSeries);
_myChart.DefaultView.ChartArea.AdditionalYAxes.Add(yAxis);
double graphVariation = maxVal - minVal;
if ((graphVariation > 2) & (graphVariation <= 9))
{
_myChart.DefaultView.ChartArea.AxisY.DefaultLabelFormat =
"n1";
}
else if (graphVariation <= 2)
{
_myChart.DefaultView.ChartArea.AxisY.DefaultLabelFormat =
"n3";
}
else
{
_myChart.DefaultView.ChartArea.AxisY.DefaultLabelFormat =
"n0";
_myChart.DefaultView.ChartArea.AxisY.DefaultLabelFormat =
"0";
}
}
private void SetLegendDetails(string legendName, ref DataSeries dataSeries, ref AxisY yAxis)
{
_myChart.DefaultView.ChartLegend.Header =
"";
_myChart.DefaultView.ChartLegend.UseAutoGeneratedItems =
true;
dataSeries.LegendLabel = legendName;
dataSeries.Definition.Appearance.Foreground =
new SolidColorBrush(Colors.Green);
Style customAxisYStyle = this.Resources["CustomAxisYStyle"] as Style;
_myChart.DefaultView.ChartArea.AxisY.AxisStyles.AxisLineStyle = customAxisYStyle;
 
}
I have attaching the Chart ScreenShot what i implemented.<telerik:ChartArea LegendName="CustomLegend" Name="chArea" NoDataString="Aucune données" DataContext="{Binding ElementName=brd1,Path=DataContext}"> <telerik:ChartArea.AxisX> <telerik:AxisX MajorGridLinesVisibility="Collapsed" Title="Heures" IsZeroBased="True" AutoRange="True" LabelStep="{Binding Intervalle}" /> </telerik:ChartArea.AxisX> <telerik:ChartArea.AxisY> <telerik:AxisY MajorGridLinesVisibility="Visible" MinorTicksVisibility="Visible" Title="Hits Lus" AutoScale="True" /> </telerik:ChartArea.AxisY> </telerik:ChartArea>grid.Items.AddNew() creates a new row in the grid. I would now like to assign a value to cell[0] in the new row.
grid.Items[0] does not contain a method to access the cells.
How do I get to the cells?
I know that binding the grid to a datatable will be much easier, but I was hoping to access the cells directly, without having to create a table for the data first.
Thx!
NewGoalWindow view = new NewGoalWindow(); view.WindowStartupLocation = WindowStartupLocation.CenterOwner; view.Owner = WindowHelper.MainWindow; NewGoalViewModel model = new NewGoalViewModel(); model.RequestClose += delegate{ view.Close(); }; view.DataContext = model; view.ShowDialog();<ListBox x:Name="multipleItemsPresenter" ItemsSource="{Binding}"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <telerik:RadTimePicker Width="80" SelectedTime="{Binding Path=Time, Mode=TwoWay}"/> <TextBlock Margin="20,0,0,0" Text="{Binding Path=Time, Mode=OneWay}"> </StackPanel> </DataTemplate> </ListBox.ItemTemplate></ListBox>