or
using System;
using System.Linq;
using System.Windows.Media;
namespace xyz
{
public partial class DBLISTitem
{
[Telerik.OpenAccess.Transient]
private Color _patternColour;
public Color PatternColour
{
get
{
return _patternColour;
}
set
{
_patternColour = value;
}
}
}
}
<
UserControl
x:Class
=
"..."
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable
=
"d"
d:DesignHeight
=
"300"
d:DesignWidth
=
"300"
>
<
Grid
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
/>
<
ColumnDefinition
Width
=
"5"
/>
<
ColumnDefinition
Width
=
"*"
/>
</
Grid.ColumnDefinitions
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"*"
/>
<
RowDefinition
Height
=
"30"
/>
<
RowDefinition
Height
=
"30"
/>
</
Grid.RowDefinitions
>
<
Grid.Resources
>
<
telerik:ColorToBrushConverter
x:Key
=
"ColorToBrushConverter"
/>
</
Grid.Resources
>
<
telerik:RadGridView
Name
=
"ocyMapyGrid"
Grid.Column
=
"0"
Grid.Row
=
"0"
Grid.ColumnSpan
=
"3"
HorizontalAlignment
=
"Left"
VerticalAlignment
=
"Stretch"
Width
=
"Auto"
IsFilteringAllowed
=
"False"
CanUserSortColumns
=
"True"
CanUserSortGroups
=
"True"
ItemsSource
=
"{Binding DBLIST, Mode=TwoWay}"
AutoGenerateColumns
=
"False"
ShowGroupPanel
=
"False"
ShowInsertRow
=
"False"
RowHeight
=
"23"
RowIndicatorVisibility
=
"Collapsed"
ScrollViewer.HorizontalScrollBarVisibility
=
"Disabled"
CanUserFreezeColumns
=
"False"
CanUserReorderColumns
=
"False"
CanUserResizeColumns
=
"True"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding ColName}"
Header
=
"Col1"
Width
=
"*"
/>
<
telerik:GridViewDataColumn
Header
=
"Colour"
Width
=
"150"
>
<
telerik:GridViewDataColumn.CellTemplate
>
<
DataTemplate
>
<
TextBlock
Text
=
"{Binding Path=PatternColour}"
Background
=
"{Binding Path=PatternColour, Converter={StaticResource ColorToBrushConverter}}"
Margin
=
"0"
/>
</
DataTemplate
>
</
telerik:GridViewDataColumn.CellTemplate
>
</
telerik:GridViewDataColumn
>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
</
Grid
>
</
UserControl
>
<
telerik:GridViewDataColumn.CellTemplate
>
<
DataTemplate
>
<
TextBlock
Text
=
"{Binding Path=HatchPatternColour}"
Margin
=
"0"
>
<
TextBlock.Background
>
<
SolidColorBrush
Color
=
"{Binding Path=HatchPatternColour}"
/>
</
TextBlock.Background
>
</
TextBlock
>
</
DataTemplate
>
</
telerik:GridViewDataColumn.CellTemplate
>
System.Windows.Data Warning: 54 : Created BindingExpression (hash=20902088)
for
Binding (hash=2322454)
System.Windows.Data Warning: 56 : Path:
'HatchPatternColour'
System.Windows.Data Warning: 58 : BindingExpression (hash=20902088): Default mode resolved to OneWay
System.Windows.Data Warning: 59 : BindingExpression (hash=20902088): Default update trigger resolved to PropertyChanged
System.Windows.Data Warning: 60 : BindingExpression (hash=20902088): Attach to System.Windows.Media.SolidColorBrush.Color (hash=53901065)
System.Windows.Data Warning: 62 : BindingExpression (hash=20902088): Use Framework mentor <
null
>
System.Windows.Data Warning: 65 : BindingExpression (hash=20902088): Resolving source
System.Windows.Data Warning: 67 : BindingExpression (hash=20902088): Framework mentor not found
System.Windows.Data Warning: 63 : BindingExpression (hash=20902088): Resolve source deferred
System.Windows.Data Warning: 93 : BindingExpression (hash=20902088): Got InheritanceContextChanged
event
from SolidColorBrush (hash=53901065)
System.Windows.Data Warning: 65 : BindingExpression (hash=20902088): Resolving source
System.Windows.Data Warning: 68 : BindingExpression (hash=20902088): Found data context element: TextBlock (hash=15347538) (OK)
System.Windows.Data Warning: 69 : BindingExpression (hash=20902088): DataContext
is
null
System.Windows.Data Warning: 65 : BindingExpression (hash=20902088): Resolving source
System.Windows.Data Warning: 68 : BindingExpression (hash=20902088): Found data context element: TextBlock (hash=15347538) (OK)
System.Windows.Data Warning: 76 : BindingExpression (hash=20902088): Activate with root item TopLevelAccountCode (hash=28952916)
System.Windows.Data Warning: 106 : BindingExpression (hash=20902088): At level 0 -
for
TopLevelAccountCode.HatchPatternColour found accessor ReflectPropertyDescriptor(HatchPatternColour)
System.Windows.Data Warning: 102 : BindingExpression (hash=20902088): Replace item at level 0 with TopLevelAccountCode (hash=28952916),
using
accessor ReflectPropertyDescriptor(HatchPatternColour)
System.Windows.Data Warning: 99 : BindingExpression (hash=20902088): GetValue at level 0 from TopLevelAccountCode (hash=28952916)
using
ReflectPropertyDescriptor(HatchPatternColour): Color (hash=1871599772)
System.Windows.Data Warning: 78 : BindingExpression (hash=20902088): TransferValue - got raw value Color (hash=1871599772)
System.Windows.Data Warning: 87 : BindingExpression (hash=20902088): TransferValue -
using
final value Color (hash=1871599772)
<
telerik:RadCartesianChart
Name
=
"CartesianChartDemo"
Margin
=
"10"
>
<
telerik:RadCartesianChart.Behaviors
>
<
telerik:ChartPanAndZoomBehavior
PanMode
=
"Both"
ZoomMode
=
"Both"
/>
</
telerik:RadCartesianChart.Behaviors
>
</
telerik:RadCartesianChart
>
CartesianChartDemo.VerticalAxis =
new
LinearAxis();
CartesianChartDemo.HorizontalAxis =
new
CategoricalAxis();
CartesianChartDemo.Grid =
new
CartesianChartGrid() { MajorLinesVisibility = GridLineVisibility.XY };
DataTable dtAlloys =
new
DataTable(
"DATA"
);
dtAlloys.Columns.Add(
new
DataColumn(
"Name"
,
typeof
(
string
)));
dtAlloys.Columns.Add(
new
DataColumn(
"Value1"
,
typeof
(
double
)));
dtAlloys.Columns.Add(
new
DataColumn(
"Value2"
,
typeof
(
double
)));
dtAlloys.Rows.Add(
new
object
[] {
"Value1"
, 70, 30 });
dtAlloys.Rows.Add(
new
object
[] {
"Value2"
, 15, 85 });
dtAlloys.Rows.Add(
new
object
[] {
"Value3"
, 50, 50 });
BarSeries barSer =
new
BarSeries();
barSer.ShowLabels =
true
;
barSer.CombineMode = ChartSeriesCombineMode.Stack100;
BarSeries barSer2 =
new
BarSeries();
barSer2.ShowLabels =
true
;
barSer2.CombineMode = ChartSeriesCombineMode.Stack100;
foreach
(DataRow drAlloy
in
dtAlloys.Rows)
{
barSer.DataPoints.Add(
new
CategoricalDataPoint() { Category = drAlloy[
"Name"
], Label =
string
.Format(
"{0:N}"
, drAlloy[
"Value1"
]), Value =
double
.Parse(drAlloy[
"Value1"
].ToString()) });
barSer2.DataPoints.Add(
new
CategoricalDataPoint() { Category = drAlloy[
"Name"
], Label =
string
.Format(
"{0:N}"
, drAlloy[
"Value2"
]), Value =
double
.Parse(drAlloy[
"Value2"
].ToString()) });
}
CartesianChartDemo.Series.Clear();
CartesianChartDemo.Series.Add(barSer);
CartesianChartDemo.Series.Add(barSer2);
<telerik:RadGridView Grid.Row="0" x:Name="HistoricalGridView" AutoGenerateColumns="False" ItemsSource="{Binding Path=HistoricalData}" IsFilteringAllowed="False" ShowGroupPanel="False" CanUserSortColumns="False" ClipboardPasteMode="OverwriteWithEmptyValues,Cells" SelectionUnit="FullRow" SelectionMode="Single" >
<
UserControl.Resources
>
<
sampleData:c_treeViewData
x:Key
=
"DataSource"
/>
<
Style
x:Key
=
"ItemContainerStyle"
TargetType
=
"telerik:RadTreeViewItem"
>
<
Setter
Property
=
"IsExpanded"
Value
=
"True"
/>
</
Style
>
<
DataTemplate
x:Key
=
"ItemEditTemplate"
>
<
Grid
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
TextBox
Text
=
"{Binding Name, Mode=TwoWay}"
/>
</
StackPanel
>
</
Grid
>
</
DataTemplate
>
<
DataTemplate
x:Key
=
"c_proprietyValue"
>
<
TextBlock
Text
=
"{Binding Name}"
FontSize
=
"14"
TextWrapping
=
"Wrap"
Width
=
"200"
/>
</
DataTemplate
>
<
HierarchicalDataTemplate
x:Key
=
"c_proprietyType"
ItemTemplate
=
"{StaticResource c_proprietyValue}"
ItemsSource
=
"{Binding propretyValues}"
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
Image
Source
=
"{Binding Image}"
Margin
=
" 0,0,6,0"
Height
=
"20"
Width
=
"20"
/>
<
TextBlock
Text
=
"{Binding Name}"
FontWeight
=
"Bold"
FontSize
=
"14"
>
<
telerik:RadContextMenu.ContextMenu
>
<
telerik:RadContextMenu
Name
=
"rcm_context1"
Opened
=
"RadContextMenu_Opened"
>
<
telerik:RadMenuItem
Name
=
"Delete"
Header
=
"Delete"
/>
<
telerik:RadMenuItem
Name
=
"Contraer"
Header
=
"Collapse tree"
/>
<
telerik:RadMenuItem
Name
=
"Expandir"
Header
=
"Expand tree"
/>
</
telerik:RadContextMenu
>
</
telerik:RadContextMenu.ContextMenu
>
</
TextBlock
>
</
StackPanel
>
</
HierarchicalDataTemplate
>
<
HierarchicalDataTemplate
x:Key
=
"c_block"
ItemTemplate
=
"{StaticResource c_proprietyType}"
ItemsSource
=
"{Binding propretyTypes}"
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
Image
Source
=
"{Binding Image}"
Margin
=
" 0,0,6,0"
Height
=
"20"
Width
=
"20"
/>
<
TextBlock
Text
=
"{Binding Name}"
FontWeight
=
"Bold"
FontSize
=
"16"
HorizontalAlignment
=
"Stretch"
>
<
telerik:RadContextMenu.ContextMenu
>
<
telerik:RadContextMenu
Opened
=
"RadContextMenu_Opened"
>
<
telerik:RadMenuItem
Name
=
"Rename"
Header
=
"Rename"
/>
<
telerik:RadMenuItem
Name
=
"Delete"
Header
=
"Delete"
/>
<
telerik:RadMenuItem
Name
=
"Contraer"
Header
=
"Collapse tree"
/>
<
telerik:RadMenuItem
Name
=
"Expandir"
Header
=
"Expand tree"
/>
</
telerik:RadContextMenu
>
</
telerik:RadContextMenu.ContextMenu
>
</
TextBlock
>
</
StackPanel
>
</
HierarchicalDataTemplate
>
</
UserControl.Resources
>