| <Window x:Class="NWLinq.Window1" |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| xmlns:local="clr-namespace:NWLinq" |
| Title="Northwind LINQ" Height="400" Width="575" xmlns:my="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"> |
| <Window.Resources> |
| <ObjectDataProvider x:Key="objectDataProvider" ObjectType="{x:Type local:TestViewModel}" /> |
| </Window.Resources> |
| <Grid DataContext="{Binding Source={StaticResource objectDataProvider}}"> |
| <Grid.ColumnDefinitions> |
| <ColumnDefinition Width="200*" /> |
| <ColumnDefinition Width="300*" /> |
| </Grid.ColumnDefinitions> |
| <Grid.RowDefinitions> |
| <RowDefinition Height="60*" /> |
| <RowDefinition Height="60*" /> |
| <RowDefinition Height="240*" /> |
| </Grid.RowDefinitions> |
| <my:RadGridView |
| Grid.Row="2" |
| Name="radGridView1" |
| Grid.ColumnSpan="2" |
| ColumnsWidthMode="Fill" |
| IsReadOnly="False" |
| SelectedItem="{Binding SelectedItem}" |
| ItemsSource="{Binding CategoryList}" |
| > |
| </my:RadGridView> |
| <TextBlock Margin="91,16,41,10" Name="textBlock1" Text="Name" HorizontalAlignment="Right" VerticalAlignment="Center" /> |
| <TextBlock Margin="91,14,41,8" Name="textBlock2" Grid.Row="1" Text="Description" HorizontalAlignment="Right" VerticalAlignment="Center" /> |
| <TextBox Grid.Column="1" Margin="58,15,64,11" Name="textBox1" Text="{Binding Path=SelectedItem.CategoryName, Mode=TwoWay}" /> |
| <TextBox Margin="58,14,64,8" Name="textBox2" Grid.Column="1" Grid.Row="1" Text="{Binding Path=SelectedItem.Description, Mode=TwoWay}" /> |
| </Grid> |
| </Window> |
| <Window x:Class="NWOA.Window1" |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| xmlns:my="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" |
| xmlns:local="clr-namespace:NWOA" |
| Title="Northwind OpenAccess" Height="400" Width="575" > |
| <Window.Resources> |
| <ObjectDataProvider x:Key="objectDataProvider" ObjectType="{x:Type local:TestViewModel}" /> |
| </Window.Resources> |
| <Grid DataContext="{Binding Source={StaticResource objectDataProvider}}"> |
| <Grid.ColumnDefinitions> |
| <ColumnDefinition Width="200*" /> |
| <ColumnDefinition Width="300*" /> |
| </Grid.ColumnDefinitions> |
| <Grid.RowDefinitions> |
| <RowDefinition Height="60*" /> |
| <RowDefinition Height="60*" /> |
| <RowDefinition Height="240*" /> |
| </Grid.RowDefinitions> |
| <my:RadGridView |
| Grid.Row="2" |
| Name="radGridView1" |
| Grid.ColumnSpan="2" |
| ColumnsWidthMode="Fill" |
| IsReadOnly="False" |
| SelectedItem="{Binding SelectedItem}" |
| ItemsSource="{Binding CategoryList}" |
| > |
| </my:RadGridView> |
| <TextBlock Margin="91,16,41,10" Name="textBlock1" Text="Name" HorizontalAlignment="Right" VerticalAlignment="Center" /> |
| <TextBlock Margin="91,14,41,8" Name="textBlock2" Grid.Row="1" Text="Description" HorizontalAlignment="Right" VerticalAlignment="Center" /> |
| <TextBox Grid.Column="1" Margin="58,15,64,11" Name="textBox1" Text="{Binding Path=SelectedItem.CategoryName, Mode=TwoWay}" /> |
| <TextBox Margin="58,14,64,8" Name="textBox2" Grid.Column="1" Grid.Row="1" Text="{Binding Path=SelectedItem.Description, Mode=TwoWay}" /> |
| </Grid> |
| </Window> |
| using System.Windows; |
| namespace NWLinq |
| { |
| public partial class Window1 : Window |
| { |
| public Window1() |
| { |
| InitializeComponent(); |
| } |
| } |
| } |
| ------- |
| using System.Windows; |
| namespace NWOA |
| { |
| public partial class Window1 : Window |
| { |
| public Window1() |
| { |
| InitializeComponent(); |
| } |
| } |
| } |
| using System.Collections.Generic; |
| using System.Linq; |
| namespace NWLinq |
| { |
| public class TestViewModel |
| { |
| NWLinqDataContext dc = new NWLinqDataContext(); |
| public TestViewModel() |
| { |
| SetTable(); |
| } |
| public void SetTable() |
| { |
| var query = |
| from c in dc.Categories select c; |
| CategoryList = query.ToList(); ; |
| } |
| public IList<Category> CategoryList |
| { |
| get; |
| set; |
| } |
| public Category SelectedItem |
| { |
| get; |
| set; |
| } |
| } |
| } |
| using System.Collections.Generic; |
| using NWOpenAccess; |
| using Telerik.OpenAccess; |
| using Telerik.OpenAccess.Query; |
| namespace NWOA |
| { |
| public class TestViewModel |
| { |
| private IObjectScope scope = NWScopeProvider.GetNewObjectScope(); |
| public TestViewModel() |
| { |
| SetTable(); |
| } |
| public void SetTable() |
| { |
| var query = |
| from c in this.scope.Extent<Category>() select c; |
| CategoryList = query.ToList(); ; |
| } |
| public IList<Category> CategoryList |
| { |
| get; |
| set; |
| } |
| public Category SelectedItem |
| { |
| get; |
| set; |
| } |
| } |
| } |
Hi.
I'm using a trial version of RadControls for WPF.
I was looking for a way to dynamically "Zoom" in/out a 2D chart( both the x and y axises).
I tried to change TicksDistance value to achieve this goal, but no use.
I thought a refresh might be needed so I added a Dispatcher.Invoke call, and steel no use.
On the AxisY I tried all the above replacing TicksDistance of AxisX with Step property of AxisY.
No use.
If "zooming" is possible in a 2D (Spline series) what is the correct way achieving it?
Thank you
Uriya
code snippet:
this
.mMyChart.RadChart1.DefaultSeriesDefinition = new SplineSeriesDefinition();
List
<Data> listData = new List<Data>();
for (int i = 0; i < oc.OctaveNotes.Length; i++)
{ listData.Add(
new Data(oc.OctaveNotes[i])); }
this
.mMyChart.RadChart1.ItemsSource = listData;
if
(e.Delta > 0)//wheel up
{
Int32 Step = this.mMyChart.RadChart1.DefaultView.ChartArea.AxisX.TicksDistance;
Step = Step / 4 * 5;
this.mMyChart.RadChart1.DefaultView.ChartArea.AxisX.TicksDistance = Step;
}
else
{
Int32 Step = this.mMyChart.RadChart1.DefaultView.ChartArea.AxisX.TicksDistance;
Step = Step / 5 * 4;
this.mMyChart.RadChart1.DefaultView.ChartArea.AxisX.TicksDistance = Step;
}
this.mMyChart.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Render, mEmptyDelegate);
public class Data
{
private DateTime mX;
public DateTime X
{
get { return mX; }
set { mX = value; }
}
private Double mY;
public Double Y
{
get { return mY; }
set { mY = value; }
}
public
Data(NoteInOctave note)
{
mX = note.NoteDateTime;
Double.TryParse(note.MesuredValue, out mY);
}
}

| <telerik:RadGridView |
| x:Name="RadGridViewGroups" |
| Grid.Row="1" |
| AutoGenerateColumns="False" |
| DataLoadMode="Asynchronous" |
| IsReadOnly="True" |
| ItemsSource="{Binding Groups}" > |
| public class GroupsViewModel : INotifyPropertyChanged |
| { |
| public ObservableCollection<TradingGroup> Groups |
| { |
| get |
| { |
| return m_Groups; |
| } |
| set |
| { |
| m_Groups = value; |
| PropertyChanged.OnPropertyChanged(this, "Groups"); |
| } |
| } |
| } |

| <telerik:RadGridView.Resources> |
| <ControlTemplate x:Key="cellTemplate" TargetType="{x:Type telerik:GridViewCell}"> |
| <CheckBox IsChecked="{Binding Field.Record.Data.Add, RelativeSource={RelativeSource TemplatedParent}}" |
| HorizontalAlignment="Center" VerticalAlignment="Center" /> |
| </ControlTemplate> |
| <Style x:Key="booleanCellStyle"> |
| <Setter Property="telerik:GridViewCell.Template" Value="{StaticResource cellTemplate}" /> |
| </Style> |
| </telerik:RadGridView.Resources> |
| <telerik:RadGridView.Columns> |
| <telerik:GridViewDataColumn UniqueName="Add" Header="" Width="Auto" CellStyle="{StaticResource booleanCellStyle}"/> |

| public class DisplayData |
| { |
| public string Name { get; set; } |
| public SomeOtherClass Prop { get; set; } |
| } |
| public class SomeOtherClass |
| { |
| public string OtherName { get; set; } |
| } |
| <telerik:GridViewDataColumn |
| Header="Name" |
| DataMemberBinding="{Binding Path=Name, Mode=OneWay}" |
| Width="2*" |
| IsReadOnly="True"/> |
| <telerik:GridViewDataColumn |
| Header="Other" |
| DataMemberBinding="{Binding Path=Prop, Mode=OneWay}" |
| Width="3*" |
| IsReadOnly="True"/> |
| <telerik:GridViewDataColumn |
| Header="Name" |
| DataMemberBinding="{Binding Path=Name, Mode=OneWay}" |
| Width="2*" |
| IsReadOnly="True"/> |
| <telerik:GridViewDataColumn |
| Header="Other" |
| DataMemberBinding="{Binding Path=Prop.OtherName, Mode=OneWay}" |
| Width="3*" |
| IsReadOnly="True"/> |
| <telerik:GridViewDataColumn |
| Header="Name" |
| DataMemberBinding="{Binding Path=Name, Mode=OneWay}" |
| Width="2*" |
| IsReadOnly="True"/> |
| <telerik:GridViewDataColumn |
| Header="Other" |
| DataMemberBinding="{Binding Path=Prop, Mode=OneWay}" |
| DisplayMemberPath="OtherName" |
| Width="3*" |
| IsReadOnly="True"/> |
