or
public DataTable GetDataTable()
{
DataTable dataTable = new DataTable();
dataTable.Columns.Add("Time", typeof(DateTime));
dataTable.Columns.Add("DoubleData", typeof(double));
dataTable.Columns.Add("Time2", typeof(DateTime));
dataTable.Columns.Add("DoubleData2", typeof(double));
for (int index = 0; index <1000; index++)
{
DataRow dataRow = dataTable.NewRow();
dataRow["DoubleData"] = 21.7003078460693;
dataRow["DoubleData2"] = 21.7003078460693 + 10;
dataRow["Time"] = DateTime.Now.AddSeconds(index);
dataRow["Time2"] = DateTime.Now.AddSeconds(index+1);
dataTable.Rows.Add(dataRow);
}
return dataTable;
}
radChart.DefaultView.ChartArea.AxisX.LayoutMode = AxisLayoutMode.Auto;
radChart.DefaultView.ChartArea.AxisX.IsDateTime = true;
radChart.DefaultView.ChartArea.AxisX .DefaultLabelFormat = "hh:mm MM:ss";
radChart.DefaultView.ChartArea.AxisX.AutoRange = true;
SeriesMapping seriesMapping = new SeriesMapping();
LineSeriesDefinition lineSeriesDefinition = new LineSeriesDefinition();
ItemMapping YItem = new ItemMapping("DoubleData", DataPointMember.YValue);
ItemMapping XItem = new ItemMapping("Time", DataPointMember.XValue);
seriesMapping.LegendLabel = "1";
lineSeriesDefinition.ShowItemLabels = false;
lineSeriesDefinition.ShowPointMarks = false;
seriesMapping.SeriesDefinition = lineSeriesDefinition;
seriesMapping.ItemMappings.Add(YItem);
seriesMapping.ItemMappings.Add(XItem);
lineSeriesDefinition.ShowItemToolTips = true;
radChart.SeriesMappings.Add(seriesMapping);
SeriesMapping seriesMapping2 = new SeriesMapping();
LineSeriesDefinition lineSeriesDefinition2 = new LineSeriesDefinition();
ItemMapping YItem2 = new ItemMapping("DoubleData2", DataPointMember.YValue);
ItemMapping XItem2 = new ItemMapping("Time2", DataPointMember.XValue);
seriesMapping2.LegendLabel = "2";
lineSeriesDefinition2.ShowItemLabels = false;
lineSeriesDefinition2.ShowPointMarks = false;
lineSeriesDefinition2.ItemLabelFormat = "mm:dd hh:MM:ss";
seriesMapping2.SeriesDefinition = lineSeriesDefinition2;
seriesMapping2.ItemMappings.Add(YItem2);
seriesMapping2.ItemMappings.Add(XItem2);
radChart.SeriesMappings.Add(seriesMapping2);
radChart.ItemsSource = GetDataTable(); <-- Error
No generic method 'Average' on type 'System.Linq.Enumerable' is compatible with the supplied type arguments and arguments. No type arguments should be provided if the method is non-generic.
public
class
Progetto
{
public
Progetto()
{
ID = 0;
Descrizione = String.Empty;
Stringhe =
new
ObservableCollection<Stringa>();
Sprites =
new
ObservableCollection<Sprite>();
}
public
int
ID {
set
;
get
; }
public
String Descrizione {
set
;
get
; }
public
ObservableCollection<Stringa> Stringhe {
set
;
get
; }
public
ObservableCollection<Sprite> Sprites {
set
;
get
; }
}
In my RadTree i'd like to see under the root node (Progetto) the two items "stringhe" and "sprites". I Tried with HierarchicalDataTemplate but with no result because under the root node i can only see "Stringhe" or "Sprites"... how to see that together ?? :
here my Hierrarchical..
<
HierarchicalDataTemplate
x:Key
=
"Stringa"
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
TextBlock
Text
=
"{Binding Ciao}"
Foreground
=
"Black"
FontWeight
=
"Bold"
FontSize
=
"12"
/>
<
TextBlock
Text
=
"{Binding Descrizione}"
Foreground
=
"Black"
FontWeight
=
"Bold"
FontSize
=
"12"
/>
</
StackPanel
>
</
HierarchicalDataTemplate
>
<
HierarchicalDataTemplate
x:Key
=
"Sprite"
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
TextBlock
Text
=
"{Binding ID}"
Foreground
=
"Black"
FontWeight
=
"Bold"
FontSize
=
"12"
/>
<
TextBlock
Text
=
"{Binding Descrizione}"
Foreground
=
"Black"
FontWeight
=
"Bold"
FontSize
=
"12"
/>
</
StackPanel
>
</
HierarchicalDataTemplate
>
<
HierarchicalDataTemplate
x:Key
=
"Progetti"
ItemsSource
=
"{Binding Stringhe}"
ItemTemplate
=
"{StaticResource Stringa}"
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
TextBlock
Text
=
"{Binding ID}"
Foreground
=
"Black"
FontWeight
=
"Bold"
FontSize
=
"12"
/>
<
TextBlock
Text
=
"{Binding Descrizione}"
Foreground
=
"Black"
FontWeight
=
"Bold"
FontSize
=
"12"
/>
</
StackPanel
>
</
HierarchicalDataTemplate
>
XamlParseExceptions
in the context of telerik RadGridView. These exceptions are caused by a denied access to tmp-files in the users temp-dir (eg: "C:\Users\XXX\AppData\Local\Temp\tmp7547.tmp"
).
System.Windows.Markup.XamlParseException: Die in der Assembly "Telerik.Windows.Controls.GridView, Version=2009.2.813.35, Culture=neutral, PublicKeyToken=5803cfa389c90ce7" definierte Instanz von "FrozenColumnsSplitter" kann nicht erstellt werden. Ein Aufrufziel hat einen Ausnahmefehler verursacht. Fehler in Objekt "PART_FrozenGridViewCellsPanel" in Markupdatei "Telerik.Windows.Controls.GridView;component/themes/office/black/DataCellsPresenter.xaml". ---> System.Reflection.TargetInvocationException: Ein Aufrufziel hat einen Ausnahmefehler verursacht. ---> System.UnauthorizedAccessException: Der Zugriff auf den Pfad "C:\Users\XXX\AppData\Local\Temp\tmp7547.tmp" wurde verweigert.
bei System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
bei System.IO.File.Delete(String path)
bei System.Windows.Input.Cursor.LoadFromStream(Stream cursorStream)
bei System.Windows.Input.Cursor..ctor(Stream cursorStream)
bei Telerik.Windows.Controls.GridView.GridViewCursors.get_RefreezeCursor()
bei Telerik.Windows.Controls.GridView.FrozenColumnsSplitter..ctor()
--- Ende der internen Ausnahmestapelüberwachung ---
bei System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
bei System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
bei System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
bei System.Activator.CreateInstance(Type type, Boolean nonPublic)
bei System.Windows.Markup.BamlRecordReader.CreateInstanceFromType(Type type, Int16 typeId, Boolean throwOnFail)