<Window x:Class="GridFormatTest.MainWindow" |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
Title="MainWindow" Height="350" Width="525" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" xmlns:System="clr-namespace:System;assembly=mscorlib"> |
<Grid Loaded="Grid_Loaded"> |
<telerik:RadGridView HorizontalAlignment="Left" Name="radGridView1" VerticalAlignment="Top" Height="311" Width="503"> |
<telerik:RadGridView.Columns> |
<telerik:GridViewDataColumn Header="Works" DataMemberBinding="{Binding Size}" DataFormatString="{}{0:N}"/> |
<telerik:GridViewDataColumn Header="Doesn't work" DataMemberBinding="{Binding SubItem.SubSize}" DataFormatString="{}{0:N}" DataType="{x:Type System:Double}"/> |
</telerik:RadGridView.Columns> |
</telerik:RadGridView> |
</Grid> |
</Window> |
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; |
namespace GridFormatTest |
{ |
public class Order |
{ |
public Order() |
{ |
this.Size = 12000.0; |
this.SubItem = new SubOrder(); |
} |
public double Size { get; private set; } |
public SubOrder SubItem { get; set; } |
} |
public class SubOrder |
{ |
public SubOrder() |
{ |
this.SubSize = 150000; |
} |
public double SubSize { get; set; } |
} |
/// <summary> |
/// Interaction logic for MainWindow.xaml |
/// </summary> |
public partial class MainWindow : Window |
{ |
public MainWindow() |
{ |
InitializeComponent(); |
} |
private void Grid_Loaded(object sender, RoutedEventArgs e) |
{ |
radGridView1.ItemsSource = new List<Order> |
{ |
new Order(), |
new Order() |
}; |
} |
} |
} |
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Stroke" TargetName="OuterPath" Value="#6600BCFF"/>
<Setter Property="Stroke" TargetName="OuterFill" Value="#6600BCFF"/>
<Setter Property="FontWeight" TargetName="HeaderElement" Value="Bold"/>
<Setter Property="FontSize" TargetName="HeaderElement" Value="16"/>
<Setter Property="Foreground" TargetName="HeaderElement" Value="Blue"/>
<Setter Property="Background" TargetName="InnerFill">
<Setter.Value>
<LinearGradientBrush EndPoint="0.500008,0" StartPoint="0.500008,1.00006">
<GradientStop Color="#FFE3F6FF" Offset="0"/>
<GradientStop Color="#FFBFEAFF" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="Fill" TargetName="InnerPath">
<Setter.Value>
<LinearGradientBrush EndPoint="0.500008,0" StartPoint="0.500008,1.00006">
<GradientStop Color="#FFE3F6FF" Offset="0"/>
<GradientStop Color="#FFBFEAFF" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsSelected" Value="False">
<Setter Property="Stroke" TargetName="OuterPath">
<Setter.Value>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#4000BCFF" Offset="0"/>
<GradientStop Color="#6600BCFF" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="Stroke" TargetName="OuterFill">
<Setter.Value>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#4000BCFF" Offset="0"/>
<GradientStop Color="#6600BCFF" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="Background" TargetName="InnerFill" Value="Transparent"/>
<Setter Property="Fill" TargetName="InnerPath" Value="White"/>
<Setter Property="Margin" TargetName="wrapper" Value="0,0,-10,-2"/>
<Setter Property="Foreground" TargetName="HeaderElement" Value="Blue"/>
<Setter Property="FontWeight" TargetName="HeaderElement" Value="Normal"/>
<Setter Property="FontSize" TargetName="HeaderElement" Value="16"/>
<Setter Property="Margin" TargetName="HeaderElement" Value="2"/>
<Setter Property="Cursor" Value="Hand"/>
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Stroke" TargetName="OuterPath">
<Setter.Value>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#4000BCFF" Offset="0"/>
<GradientStop Color="#6600BCFF" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="Stroke" TargetName="OuterFill">
<Setter.Value>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#4000BCFF" Offset="0"/>
<GradientStop Color="#6600BCFF" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="Background" TargetName="InnerFill" Value="Transparent"/>
<Setter Property="Fill" TargetName="InnerPath" Value="White"/>
<Setter Property="Margin" TargetName="wrapper" Value="0,0,-10,-2"/>
<Setter Property="Foreground" TargetName="HeaderElement" Value="#262626"/>
<Setter Property="FontWeight" TargetName="HeaderElement" Value="Bold"/>
<Setter Property="FontSize" TargetName="HeaderElement" Value="16"/>
<Setter Property="Margin" TargetName="HeaderElement" Value="2"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" TargetName="HeaderElement" Value="0.5"/>
</Trigger>
</ControlTemplate.Triggers>
switch (navigationDirection) |
{ |
case FocusNavigationDirection.Next: |
case FocusNavigationDirection.Previous: |
if (!this.CurrentCell.IsInEditMode) |
{ //... |
case FocusNavigationDirection.Left: |
case FocusNavigationDirection.Right: |
case FocusNavigationDirection.Up: |
case FocusNavigationDirection.Down: |
currentCellContainer = this.OnArrowKeyDown(this.CurrentCell, navigationDirection); |
if ((this.CurrentCell != null) && this.CurrentCell.IsInEditMode) |
{ //... |
<radGrid:GridViewDataColumn Header="State" Width="090" Background="{Binding Path=State, Converter={StaticResource StateToColorConverter}}" DataMemberBinding="{Binding Path=State}"/> |
<radGrid:RadGridView ItemsSource="{Binding Orders}" > |
<radGrid:RadGridView.Columns> |
<radGrid:GridViewDataColumn Header="State" Width="090" Background="{Binding Path=State, Converter={StaticResource StateToColorConverter}}" DataMemberBinding="{Binding Path=State}"/> |
</radGrid:RadGridView.Columns> |
</radGrid:RadGridView> |
private ObservableCollection<SingleOrder> _orders = new ObservableCollection<SingleOrder>() |
public ObservableCollection<SingleOrder> Orders { get { return _orders; } } |
public class SingleOrder |
: ViewModelBase |
{ |
private Instrument _instrument; |
public Instrument Instrument |
{ |
get { return _instrument; } |
set |
{ |
if (!Instrument.Equals(_instrument, value)) |
{ |
_instrument = value; |
this.OnPropertyChanged("Instrument"); |
} |
} |
} |
private System.String _state; |
public System.String State |
{ |
get { return _state; } |
set |
{ |
if (!String.Equals(_state, value)) |
{ |
_state = value; |
this.OnPropertyChanged("State"); |
} |
} |
} |
} |
// Create a new image object and add it to bing map.
Uri uri = new Uri(@"" + imageName, UriKind.Relative);
BitmapImage bitmap = new BitmapImage();
bitmap.BeginInit();
bitmap.UriSource = uri;
bitmap.EndInit();
Image image = new Image();
image.Source = bitmap;
image.Opacity = 0.85;
image.Width = imageWidth;
image.Height = imageHeight;
image.Stretch = Stretch.UniformToFill;
image.SnapsToDevicePixels = true;
image.Name = Name;
// When added to map, centre image over Lat/Long rather than use upper left corner for placement
image.VerticalAlignment = VerticalAlignment.Center;
image.HorizontalAlignment = HorizontalAlignment.Center;
// Add the image to the map
MapLayer.SetLocation(image, new Location(dLatitude, dLongitude));
iLayer.Items.Add(image);
Hello!
I’m working with your Chart, and I found it working incorrectly.
<QuickStart:ExampleControl x:Class="Telerik.Windows.Examples.Chart.WPF.TwoDimensional.Bar.Example"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:QuickStart="clr-namespace:Telerik.Windows.QuickStart;assembly=Telerik.Windows.QuickStart"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
<Grid>
<telerik:RadChart x:Name="RadChart1"/>
</Grid>
</QuickStart:ExampleControl>
As a result I expect to see a Chart of 0x0 size, but instead it’s 800x600.
I do not understand where this size comes from, because it’s not written anywhere.
How can I solve that problem?
The matter is crucial for me, since in my application I need to implement the floating layout.
Thank you very much.
RadarSoft