<Window x:Class="GraphTest.Window1" |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" |
Title="Window1" Height="400" Width="600" Loaded="Window_Loaded"> |
<Grid> |
<telerik:RadChart x:Name="MainChart"></telerik:RadChart> |
</Grid> |
</Window> |
Window1.xaml.cs
using System; |
using System.Collections.Generic; |
using System.Linq; |
using System.Text; |
using System.Windows; |
using System.Windows.Controls; |
using System.Windows.Data; |
using System.Windows.Documents; |
using System.Windows.Input; |
using System.Windows.Media; |
using System.Windows.Media.Imaging; |
using System.Windows.Navigation; |
using System.Windows.Shapes; |
using Telerik.Windows.Controls.Charting; |
namespace GraphTest |
{ |
/// <summary> |
/// Interaction logic for Window1.xaml |
/// </summary> |
public partial class Window1 : Window |
{ |
public Window1() |
{ |
InitializeComponent(); |
} |
class DataEntry |
{ |
public DateTime dt { get; set; } |
public double value { get; set; } |
} |
private void Window_Loaded(object sender, RoutedEventArgs e) |
{ |
MainChart.DefaultView.ChartArea.AxisX.IsDateTime = true; |
ISeriesDefinition definition = new StackedBarSeriesDefinition(); |
DataSeries dataSeries1 = new DataSeries() { Definition = definition }; |
DataSeries dataSeries2 = new DataSeries() { Definition = definition }; |
DateTime time1 = DateTime.Today; |
DateTime time2 = time1 + new TimeSpan(1, 0, 0, 0); |
DateTime time3 = time2 + new TimeSpan(1, 0, 0, 0); |
DateTime time4 = time3 + new TimeSpan(1, 0, 0, 0); |
List<DataEntry> testData1 = new List<DataEntry>() { |
new DataEntry() { dt = time1, value = 10.0 }, |
new DataEntry() { dt = time2, value = 15.0 }, |
new DataEntry() { dt = time3, value = 20.0 }}; |
// notice that testData2 is shiftet 24 hrs from testData1 |
List<DataEntry> testData2 = new List<DataEntry>() { |
new DataEntry() { dt = time2, value = 30.0 }, |
new DataEntry() { dt = time3, value = 40.0 }, |
new DataEntry() { dt = time4, value = 20.0 }}; |
foreach (DataEntry entry in testData1) |
dataSeries1.Add( new DataPoint(entry.dt) { YValue = (double)entry.value }); |
foreach (DataEntry entry in testData2) |
dataSeries2.Add(new DataPoint(entry.dt) { YValue = (double)entry.value }); |
MainChart.DefaultView.ChartArea.DataSeries.Add(dataSeries1); |
MainChart.DefaultView.ChartArea.DataSeries.Add(dataSeries2); |
} |
} |
} |
Hello.
This issue is not big problem but still I think it could behave better. It is hard to describe what I mean and so I made this short video capture:
http://www.youtube.com/watch?v=m7mH0iRq-Gw
It is about range slider where I start to drag right slider to left until range is zero (for example like in video 21-21) then I keep mouse button down and move with mouse to the left and with mouse button still pressed I move back to the right again.
Then right slider should start to move to 21-22 and then 21-23 and so on but this is not happening. When I keep moving mouse to the right it later jumps to 21-26 and then 21-29 or something similar.
So trying to drag right slider too much to left visually makes nothing but it seems like inside RadSlider is something changing for some reason.
(It is same with left slider, I just used right as example.)
Best regards,
Michal
Hi,
I am new to the WPF world but I am trying to use the RadGridView in a ViewModel (MVVM) architecture.
Normally al my ViewModels contain a SelectedProduct property which automatically enables other realted commands in the UI. (change,view, etc).
This is working perfectly in the included ListBox control:
<ListBox ItemsSource="{Binding Products}"
SelectedItem="{Binding SelectedProduct}"
DisplayMemberPath="Product.ProductName">
</ListBox>
When trying the same in your Telerik RadGrid it fails my property setter never gets called.
<telerik:RadGridView telerik:Theming.Theme="Vista"
MultipleSelect="False"
ItemsSource="{Binding Products}" IsReadOnly="False"
SelectedItem="{Binding SelectedProduct}"
ColumnsWidthMode="Fill" AutoGenerateColumns="False">
<telerik:RadGridView.Columns>
The SelectionChanged event off course works and raises every time I click / move on another item but I am expecting my "SelectedProduct" property to be automatically updated (setter never called).
This SelectedProduct property get's called on the getter so actually it's used/read.
Looks like it's not using 2-way binding...
Any ideas what I am doing wrong??
I have a grid with a decimal column in it. When i try to type a number with a decimal (ie 101.5), on press of the decimal key (period) the mouse cursor returns to the beginning of the column.
GridViewDataColumn
valueColumn = new GridViewDataColumn();
valueColumn.Name =
"Value";
valueColumn.UniqueName =
"Value";
valueColumn.HeaderText =
"Value";
valueColumn.DataMemberPath =
"Value";
valueColumn.Width =
new GridLength(80);
valueColumn.DataType =
typeof(decimal);
valueColumn.IsSortable =
false;
Thanks for any help.
-Brandon