<
telerik:RadTileView
IsDockingEnabled
=
"True"
Style
=
"{StaticResource TileGraphStyle}"
ItemsSource
=
"{Binding TechnicalItemsPerformance}"
>
<
telerik:RadTileView.ContentTemplate
>
<
DataTemplate
x:Uid
=
"DataTemplate_11"
>
<
telerik:RadChart
Name
=
"chartTechnicalItemsMax"
Background
=
"Transparent"
BorderThickness
=
"0"
IsTabStop
=
"False"
UseDefaultLayout
=
"False"
ItemsSource
=
"{Binding StatusGroup}"
PaletteBrushes
=
"{Binding BrushPalette}"
ToolTip
=
"Display matching technical items by libraries"
x:Uid
=
"chartTechnicalitems"
>
<
telerik:RadChart.SeriesMappings
>
<
telerik:SeriesMapping
x:Uid
=
"telerik:SeriesMapping_12"
LegendLabel
=
"Success"
CollectionIndex
=
"0"
ChartAreaName
=
"ItemArea"
>
<
telerik:SeriesMapping.SeriesDefinition
>
<
telerik:HorizontalStackedBarSeriesDefinition
x:Uid
=
"telerik:StackedBarSeriesDefinition_12"
ShowItemLabels
=
"True"
>
<
telerik:HorizontalStackedBarSeriesDefinition.ItemStyle
>
<
Style
x:Uid
=
"Style_22"
TargetType
=
"{x:Type telerik:HorizontalStackedBar}"
>
<
Setter
x:Uid
=
"Setter_208"
Property
=
"Template"
>
<
Setter.Value
>
<
ControlTemplate
x:Uid
=
"ControlTemplate_1"
TargetType
=
"{x:Type telerik:HorizontalStackedBar}"
>
<
Canvas
x:Uid
=
"PART_MainContainer"
x:Name
=
"PART_MainContainer"
Opacity
=
"0"
>
<
Canvas.ContextMenu
>
<
ContextMenu
x:Uid
=
"ContextMenu_1"
>
<
MenuItem
x:Uid
=
"MenuItem_1"
Header
=
"Go to class"
Command
=
"{Binding StartFreeLearn}"
/>
</
ContextMenu
>
</
Canvas.ContextMenu
>
<
Canvas.RenderTransform
>
<
ScaleTransform
x:Uid
=
"ScaleTransform_1"
ScaleX
=
"0"
/>
</
Canvas.RenderTransform
>
<
VisualStateManager.VisualStateGroups
>
<
VisualStateGroup
x:Uid
=
"HoverStates"
x:Name
=
"HoverStates"
>
<
VisualState
x:Uid
=
"Normal"
x:Name
=
"Normal"
>
<
Storyboard
x:Uid
=
"Storyboard_1"
>
<
DoubleAnimation
x:Uid
=
"DoubleAnimation_1"
Duration
=
"0:0:0.15"
To
=
"1"
Storyboard.TargetProperty
=
"Opacity"
Storyboard.TargetName
=
"PART_MainContainer"
/>
</
Storyboard
>
</
VisualState
>
<
VisualState
x:Uid
=
"Hovered"
x:Name
=
"Hovered"
>
<
Storyboard
x:Uid
=
"Storyboard_2"
>
<
DoubleAnimation
x:Uid
=
"DoubleAnimation_2"
Duration
=
"0:0:0.15"
To
=
"1"
Storyboard.TargetProperty
=
"Opacity"
Storyboard.TargetName
=
"PART_MainContainer"
/>
</
Storyboard
>
</
VisualState
>
<
VisualState
x:Uid
=
"Hidden"
x:Name
=
"Hidden"
>
<
Storyboard
x:Uid
=
"Storyboard_3"
>
<
DoubleAnimation
x:Uid
=
"DoubleAnimation_3"
Duration
=
"0:0:0.15"
To
=
"0.15"
Storyboard.TargetProperty
=
"Opacity"
Storyboard.TargetName
=
"PART_MainContainer"
/>
</
Storyboard
>
</
VisualState
>
</
VisualStateGroup
>
<
VisualStateGroup
x:Uid
=
"SelectionStates"
x:Name
=
"SelectionStates"
>
<
VisualState
x:Uid
=
"Unselected"
x:Name
=
"Unselected"
/>
<
VisualState
x:Uid
=
"Selected"
x:Name
=
"Selected"
>
<
Storyboard
x:Uid
=
"Storyboard_4"
>
<
ObjectAnimationUsingKeyFrames
x:Uid
=
"ObjectAnimationUsingKeyFrames_1"
Duration
=
"0:0:0.05"
Storyboard.TargetProperty
=
"Stroke"
Storyboard.TargetName
=
"PART_SelectedState"
>
<
DiscreteObjectKeyFrame
x:Uid
=
"DiscreteObjectKeyFrame_1"
KeyTime
=
"0"
>
<
DiscreteObjectKeyFrame.Value
>
<
SolidColorBrush
x:Uid
=
"SolidColorBrush_1"
Color
=
"#B2000000"
/>
</
DiscreteObjectKeyFrame.Value
>
</
DiscreteObjectKeyFrame
>
</
ObjectAnimationUsingKeyFrames
>
<
ObjectAnimationUsingKeyFrames
x:Uid
=
"ObjectAnimationUsingKeyFrames_2"
Duration
=
"0:0:0.05"
Storyboard.TargetProperty
=
"StrokeThickness"
Storyboard.TargetName
=
"PART_SelectedState"
>
<
DiscreteObjectKeyFrame
x:Uid
=
"DiscreteObjectKeyFrame_2"
KeyTime
=
"0"
Value
=
"2"
>
</
DiscreteObjectKeyFrame
>
</
ObjectAnimationUsingKeyFrames
>
</
Storyboard
>
</
VisualState
>
</
VisualStateGroup
>
</
VisualStateManager.VisualStateGroups
>
<
Rectangle
x:Uid
=
"PART_DefiningGeometry"
x:Name
=
"PART_DefiningGeometry"
Height
=
"{TemplateBinding ItemActualHeight}"
RadiusY
=
"1"
RadiusX
=
"1"
Style
=
"{TemplateBinding ItemStyle}"
Width
=
"{TemplateBinding ItemActualWidth}"
/>
<
Rectangle
x:Uid
=
"Rectangle_1"
Height
=
"{TemplateBinding ItemActualHeight}"
OpacityMask
=
"Black"
RadiusY
=
"1"
RadiusX
=
"1"
Stroke
=
"Transparent"
StrokeThickness
=
"0"
Width
=
"{TemplateBinding ItemActualWidth}"
>
<
Rectangle.Fill
>
<
LinearGradientBrush
x:Uid
=
"LinearGradientBrush_1"
EndPoint
=
"0.5,1"
StartPoint
=
"0.5,0"
>
<
GradientStop
x:Uid
=
"GradientStop_1"
Color
=
"Transparent"
/>
<
GradientStop
x:Uid
=
"GradientStop_2"
Color
=
"Transparent"
Offset
=
"1"
/>
<
GradientStop
x:Uid
=
"GradientStop_3"
Color
=
"#19FFFFFF"
Offset
=
"0.2"
/>
<
GradientStop
x:Uid
=
"GradientStop_4"
Color
=
"#B2FFFFFF"
Offset
=
"0.2"
/>
</
LinearGradientBrush
>
</
Rectangle.Fill
>
</
Rectangle
>
<
Rectangle
x:Uid
=
"PART_SelectedState"
x:Name
=
"PART_SelectedState"
Fill
=
"Transparent"
Height
=
"{TemplateBinding ItemActualHeight}"
RadiusY
=
"1"
RadiusX
=
"1"
Width
=
"{TemplateBinding ItemActualWidth}"
/>
</
Canvas
>
</
ControlTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
</
telerik:HorizontalStackedBarSeriesDefinition.ItemStyle
>
</
telerik:HorizontalStackedBarSeriesDefinition
>
</
telerik:SeriesMapping.SeriesDefinition
>
<
telerik:SeriesMapping.ItemMappings
>
<
telerik:ItemMapping
x:Uid
=
"telerik:ItemMapping_23"
DataPointMember
=
"YValue"
FieldName
=
"Count"
/>
<
telerik:ItemMapping
x:Uid
=
"telerik:ItemMapping_24"
DataPointMember
=
"XCategory"
FieldName
=
"Name"
/>
</
telerik:SeriesMapping.ItemMappings
>
</
telerik:SeriesMapping
>
<
telerik:SeriesMapping
x:Uid
=
"telerik:SeriesMapping_13"
ChartAreaName
=
"ItemArea"
LegendLabel
=
"Hesitation"
CollectionIndex
=
"1"
>
<
telerik:SeriesMapping.SeriesDefinition
>
<
telerik:HorizontalStackedBarSeriesDefinition
x:Uid
=
"telerik:StackedBarSeriesDefinition_13"
ItemStyle
=
"{StaticResource TechnicalBarStyle}"
ShowItemLabels
=
"True"
/>
</
telerik:SeriesMapping.SeriesDefinition
>
<
telerik:SeriesMapping.ItemMappings
>
<
telerik:ItemMapping
x:Uid
=
"telerik:ItemMapping_25"
DataPointMember
=
"YValue"
FieldName
=
"Count"
/>
<
telerik:ItemMapping
x:Uid
=
"telerik:ItemMapping_26"
DataPointMember
=
"XCategory"
FieldName
=
"Name"
/>
</
telerik:SeriesMapping.ItemMappings
>
</
telerik:SeriesMapping
>
<
telerik:SeriesMapping
x:Uid
=
"telerik:SeriesMapping_14"
ChartAreaName
=
"ItemArea"
LegendLabel
=
"Unknown"
CollectionIndex
=
"2"
>
<
telerik:SeriesMapping.SeriesDefinition
>
<
telerik:HorizontalStackedBarSeriesDefinition
x:Uid
=
"telerik:StackedBarSeriesDefinition_14"
ItemStyle
=
"{StaticResource TechnicalBarStyle}"
ShowItemLabels
=
"True"
/>
</
telerik:SeriesMapping.SeriesDefinition
>
<
telerik:SeriesMapping.ItemMappings
>
<
telerik:ItemMapping
x:Uid
=
"telerik:ItemMapping_27"
DataPointMember
=
"YValue"
FieldName
=
"Count"
/>
<
telerik:ItemMapping
x:Uid
=
"telerik:ItemMapping_28"
DataPointMember
=
"XCategory"
FieldName
=
"Name"
/>
</
telerik:SeriesMapping.ItemMappings
>
</
telerik:SeriesMapping
>
<
telerik:SeriesMapping
x:Uid
=
"telerik:SeriesMapping_15"
ChartAreaName
=
"ItemArea"
LegendLabel
=
"Misrecognition"
CollectionIndex
=
"3"
>
<
telerik:SeriesMapping.SeriesDefinition
>
<
telerik:HorizontalStackedBarSeriesDefinition
x:Uid
=
"telerik:StackedBarSeriesDefinition_15"
ItemStyle
=
"{StaticResource TechnicalBarStyle}"
ShowItemLabels
=
"True"
/>
</
telerik:SeriesMapping.SeriesDefinition
>
<
telerik:SeriesMapping.ItemMappings
>
<
telerik:ItemMapping
x:Uid
=
"telerik:ItemMapping_29"
DataPointMember
=
"YValue"
FieldName
=
"Count"
/>
<
telerik:ItemMapping
x:Uid
=
"telerik:ItemMapping_30"
DataPointMember
=
"XCategory"
FieldName
=
"Name"
/>
</
telerik:SeriesMapping.ItemMappings
>
</
telerik:SeriesMapping
>
</
telerik:RadChart.SeriesMappings
>
<
Grid
x:Uid
=
"Grid_8"
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
x:Uid
=
"ColumnDefinition_15"
Width
=
"*"
/>
<
ColumnDefinition
x:Uid
=
"ColumnDefinition_16"
Width
=
"Auto"
/>
</
Grid.ColumnDefinitions
>
<
ScrollViewer
x:Uid
=
"ScrollViewer_1"
Grid.Column
=
"0"
HorizontalScrollBarVisibility
=
"Disabled"
VerticalScrollBarVisibility
=
"Auto"
>
<
telerik:ChartArea
x:Uid
=
"ItemArea"
x:Name
=
"ItemArea"
NoDataString
=
"Not available"
/>
</
ScrollViewer
>
<
telerik:ChartLegend
x:Uid
=
"telerik:ChartLegend_2"
Grid.Column
=
"1"
Style
=
"{StaticResource ClassificationLegendStyle}"
/>
</
Grid
>
</
telerik:RadChart
>
</
DataTemplate
>
</
telerik:RadTileView.ContentTemplate
>
<
telerik:RadTileView.ItemTemplate
>
<
DataTemplate
x:Uid
=
"DataTemplate_5"
>
<
TextBlock
x:Uid
=
"TextBlock_12"
Text
=
"{Binding Name}"
/>
</
DataTemplate
>
</
telerik:RadTileView.ItemTemplate
>
</
telerik:RadTileView
>
<
Controls1:RadScheduleView
Grid.Row
=
"1"
CurrentDate ="{Binding Path=. ,
Mode
=
TwoWay
,
Converter={StaticResource crossRegistersToDayStartEndTime},
ConverterParameter={x:Static Converters:DateTimeDirection.None}}"
AppointmentsSource
=
"{Binding Path=., Converter={StaticResource crossRegistersToAppointmentConverter}}"
>
<
Controls1:RadScheduleView.ActiveViewDefinition
>
<
Controls1:TimelineViewDefinition
Orientation
=
"Horizontal"
DayStartTime
=
"04:00"
DayEndTime
=
"16:00"
VisibleDays
=
"2"
/>
</
Controls1:RadScheduleView.ActiveViewDefinition
>
<
Controls1:RadScheduleView.ResourceTypesSource
>
<
Controls1:ResourceTypeCollection
>
<
Controls1:ResourceType
Name
=
"RcpCalculation"
>
<
Controls1:Resource
ResourceName
=
"RcpTimeTable"
/>
<
Controls1:Resource
ResourceName
=
"RcpCrossRegister"
/>
</
Controls1:ResourceType
>
</
Controls1:ResourceTypeCollection
>
</
Controls1:RadScheduleView.ResourceTypesSource
>
</
Controls1:RadScheduleView
>
Problem occures when I change VisibleDays = "1"
Although all appointments are located in the one day (the first one), none of them are shown...
I use 01535RadControls_for_WPF40_2011_2_0912_TRIAL_hotfix.
What is wrong?
thanks in advance
Robert
this
._contentDocking.ActivePane
Hi all, it's a long story, I have to show data in a grid, I were forced to use a datatable to represent records, luckily the radgridview works like a charm with datatables.
When i add a record to the datatable I call Rebind to let the grid stay in sync. And that worked fine for months.
Now the customer wants that when a record is inserted the grid scroll to show the latest record inserted.
So i tried the scrollintoview with no success. Then i used the BringIndexIntoView that worked.
But after the call to BringIndexIntoView the following call to Rebind generate a NullReferenceException.
Also note that if I try to catch the exception and show a standard windows messagebox the messagebox too raise an exception. Seems like the call to BringIndexIntoView messed up the program.
To reproduce the error i created a project if that can help. Just copy into a new VS2010 WPF project named WpfApplication1 using telerik 2010 Q1 SP2 and framework 4.0.
When running click on reset datasource then click twice on add record.
//MainWindow.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
System.Data;
namespace
WpfApplication1
{
public
partial
class
MainWindow : Window
{
SampleData sd;
public
MainWindow() {
InitializeComponent();
}
private
void
button1_Click(
object
sender, RoutedEventArgs e) {
BindToNewDS();
}
private
void
BindToNewDS() {
sd =
new
SampleData(50);
radGridView1.ItemsSource = sd.TheTable;
}
private
void
button2_Click(
object
sender, RoutedEventArgs e) {
int
idx = sd.CreateSampleRecord();
radGridView1.Rebind();
DataRow dr = (radGridView1.ItemsSource
as
DataTable).Rows
.Find(
new
Object[] { idx });
if
(radGridView1.Items.Contains(dr))
{
int
iof = radGridView1.Items.IndexOf(dr);
radGridView1.BringIndexIntoView(iof);
}
}
}
}
MainWindow.xaml
<
Window
x:Class
=
"WpfApplication1.MainWindow"
Title
=
"MainWindow"
Height
=
"350"
Width
=
"525"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
>
<
Grid
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"45"
></
RowDefinition
>
<
RowDefinition
Height
=
"*"
></
RowDefinition
>
</
Grid.RowDefinitions
>
<
telerik:RadGridView
ShowInsertRow
=
"False"
CanUserInsertRows
=
"False"
RowHeight
=
"22"
SelectionMode
=
"Extended"
Grid.Row
=
"1"
Name
=
"radGridView1"
IsReadOnly
=
"True"
>
<
telerik:RadGridView.Columns
>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
<
Button
Content
=
"Reset datasource"
Height
=
"29"
HorizontalAlignment
=
"Left"
Margin
=
"16,11,0,0"
Name
=
"button1"
VerticalAlignment
=
"Top"
Width
=
"94"
Click
=
"button1_Click"
/>
<
Button
Content
=
"Add record and scroll to"
Height
=
"30"
HorizontalAlignment
=
"Left"
Margin
=
"132,10,0,0"
Name
=
"button2"
VerticalAlignment
=
"Top"
Width
=
"144"
Click
=
"button2_Click"
/>
</
Grid
>
</
Window
>
//SampleData.cs
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
using
System.ComponentModel;
using
System.Data;
namespace
WpfApplication1
{
class
SampleData
{
//define fixed columns
private
DataColumn[] fixedColumns =
new
DataColumn[] {
new
DataColumn(
"Equipment"
,
typeof
(
string
)),
new
DataColumn(
"Place Of Receipt"
,
typeof
(
string
)),
new
DataColumn(
"Port Of Load"
,
typeof
(
string
)),
new
DataColumn(
"Port Of Discharge"
,
typeof
(
string
)),
new
DataColumn(
"Delivery Place"
,
typeof
(
string
))
};
//define variable columns, only a random subset of these columns will be added to resulting table
private
DataColumn[] varColumns =
new
DataColumn[] {
new
DataColumn(
"Freight"
,
typeof
(
decimal
)),
new
DataColumn(
"Bunker"
,
typeof
(
decimal
)),
new
DataColumn(
"Peak season"
,
typeof
(
decimal
)),
new
DataColumn(
"Pickup costs"
,
typeof
(
decimal
)),
new
DataColumn(
"Delivery costs"
,
typeof
(
decimal
))
};
private
string
[][] sampleData =
new
string
[][] {
new
string
[] {
"Equipment"
,
"20 box"
,
"20 o.t."
,
"40 box"
,
"40 o.t."
,
"40 h.c."
},
new
string
[] {
"Place Of Receipt"
,
"Lyon"
,
"Tolouse"
,
"Torino"
,
"Milano"
,
"Verona"
,
"Madrid"
},
new
string
[] {
"Port Of Load"
,
"Marseille"
,
"Genova"
,
"La Spezia"
,
"Barcelona"
,
"Napoli"
},
new
string
[] {
"Port Of Discharge"
,
"New York"
,
"Montreal ramp"
,
"Norfolk"
,
"Miami"
,
"Savannah"
},
new
string
[] {
"Delivery Place"
,
"Atlanta"
,
"Jersey City, NJ"
,
"Edison, NJ"
,
"Oaks, PA"
,
"Taftsville, CT"
},
};
private
Random randGenerator =
new
Random();
private
int
LastID = 0;
public
SampleData(
int
initialRecordCount)
{
GenerateTableDefinition();
CreateSampleRecord();
for
(
int
i = 1; i < initialRecordCount; ++i)
CreateSampleRecord();
}
public
int
CreateSampleRecord()
{
var row = m_TheTable.NewRow();
LastID += randGenerator.Next(99)+1;
row[
"ID"
] = LastID;
m_TheTable.Rows.Add(row);
foreach
(DataColumn dc
in
m_TheTable.Columns)
{
string
[] sample;
int
randIdx;
sample = sampleData.FirstOrDefault(a => a[0].Equals(dc.ColumnName));
if
(sample !=
null
)
{
randIdx = randGenerator.Next(sample.Count() - 2);
row[dc] = sample[randIdx + 1];
}
if
(dc.DataType ==
typeof
(
decimal
))
{
row[dc] = (
decimal
)(randGenerator.Next(60) * 50);
}
}
return
LastID;
}
private
void
GenerateTableDefinition()
{
//creating table
DataTable dt =
new
DataTable(
"FreightRates"
);
//creating primary key
dt.Columns.Add(
new
DataColumn(
"ID"
,
typeof
(
int
)));
//adding fixed columns to table
foreach
(DataColumn dc
in
fixedColumns)
{
dt.Columns.Add(dc);
}
//selecting randomly a number of variable columns to be added to the table
List<DataColumn> varColumnList = varColumns.ToList();
int
numberOfVariableColumns = randGenerator.Next(varColumnList.Count() - 1);
for
(
int
i = 0; i < numberOfVariableColumns; ++i)
{
int
randomlySelectedColumn = randGenerator.Next(varColumnList.Count() - 1);
dt.Columns.Add(varColumnList[i]);
varColumnList.RemoveAt(i);
}
//expliciting primary key
dt.PrimaryKey =
new
DataColumn[] { dt.Columns[
"ID"
] };
TheTable = dt;
}
private
DataTable m_TheTable;
public
DataTable TheTable
{
get
{
return
this
.m_TheTable; }
private
set
{
if
(value !=
this
.m_TheTable)
{
this
.m_TheTable = value;
}
}
}
}
}
<
telerik:RadTransitionControl
x:Name
=
"TransitionControl"
SnapsToDevicePixels
=
"True"
Margin
=
"130,124,100,184"
>
<
telerik:RadTransitionControl.ContentTemplate
>
<
DataTemplate
>
<
StackPanel
>
<
WrapPanel
Orientation
=
"Horizontal"
>
<
WrapPanel.Resources
>
<
Style
TargetType
=
"{x:Type Image}"
>
<
Setter
Property
=
"Margin"
Value
=
"10,10"
/>
</
Style
>
</
WrapPanel.Resources
>
<
Image
Height
=
"250"
Width
=
"180"
DataContext
=
"{Binding}"
Source
=
"/Kintrol;component/Images/300.jpg"
/>
<
Image
Source
=
"Images/1.jpg"
Height
=
"250"
Width
=
"180"
/>
<
Image
Source
=
"Images/2.jpg"
Height
=
"250"
Width
=
"180"
/>
<
Image
Source
=
"Images/3.jpg"
Height
=
"250"
Width
=
"180"
/>
<
Image
Source
=
"Images/4.jpg"
Height
=
"250"
Width
=
"180"
/>
<
Image
Source
=
"Images/5.jpg"
Height
=
"250"
Width
=
"180"
/>
<
Image
Source
=
"Images/6.jpg"
Height
=
"250"
Width
=
"180"
/>
<
Image
Source
=
"Images/7.jpg"
Height
=
"250"
Width
=
"180"
/>
<
Image
Source
=
"Images/8.jpg"
Height
=
"250"
Width
=
"180"
/>
<
Image
Source
=
"Images/9.jpg"
Height
=
"250"
Width
=
"180"
/>
</
WrapPanel
>
</
StackPanel
>
</
DataTemplate
>
</
telerik:RadTransitionControl.ContentTemplate
>
<
telerik:RadTransitionControl.Transition
>
<
telerik:SlideAndZoomTransition
/>
</
telerik:RadTransitionControl.Transition
>
</
telerik:RadTransitionControl
>
<
Image
Source
=
"Images/next.png"
Margin
=
"1134,332,12,359"
/>
<
Image
Source
=
"Images/previous.png"
Margin
=
"12,262,1134,334"
/>