I am creating a drag and drop dashboard page and I need some assistance with the drag and drop from RadTreeView to Grid. My goal is to drag an item from the tree which is text base, and have it render a user control at the point of drop on the Grid.
I have been looking for an example of this with no luck and was hoping this is possible. If it is possible do you have an example project that demonstrates this?
<Grid Name="cDashboardGrid" Background="White">
</Grid>
Public
Class
TempInfo
Public
Property
Timestamp
As
DateTime
Public
Property
SensorIndex
As
Int32
Public
Property
Temperature
As
Single
Public
Sub
New
(
ByVal
adTimestamp
As
DateTime,
ByVal
aiSensorIndex
As
Int32,
ByVal
afTemperature
As
Single
)
Timestamp = adTimestamp
SensorIndex = aiSensorIndex
Temperature = afTemperature
End
Sub
End
Class
Class
MainWindow
Private
Sub
MainWindow_Loaded(sender
As
Object
, e
As
System.Windows.RoutedEventArgs)
Handles
Me
.Loaded
Dim
infos
As
New
List(Of TempInfo)
Dim
loRandom
As
New
Random
For
liDateCounter
As
Int32 = 1
To
10000
For
liSensorCounter
As
Int32 = 1
To
12
infos.Add(
New
TempInfo(DateTime.Now.AddHours(liDateCounter), liSensorCounter, loRandom.
Next
(70, 90)))
Next
Next
RadHeatMap1.Definition.ItemsSource = infos
End
Sub
End
Class
<Window x:
Class
=
"MainWindow"
Title=
"MainWindow"
Height=
"350"
Width=
"525"
xmlns:telerik=
"http://schemas.telerik.com/2008/xaml/presentation"
>
<Grid>
<telerik:RadHeatMap HorizontalAlignment=
"Stretch"
Name=
"RadHeatMap1"
VerticalAlignment=
"Stretch"
SnapsToDevicePixels=
"True"
UseLayoutRounding=
"True"
>
<telerik:RadHeatMap.Definition>
<telerik:CategoricalDefinition ItemsSource=
"{Binding}"
RowGroupMemberPath=
"SensorIndex"
ColumnGroupMemberPath=
"Timestamp"
ValuePath=
"Temperature"
/>
</telerik:RadHeatMap.Definition>
</telerik:RadHeatMap>
</Grid>
</Window>
<telerik:RadChart x:Name="xRadChartECG1" Grid.Column="1" ItemsSource="{Binding xSource}"> <telerik:RadChart.DefaultView> <telerik:ChartDefaultView> <telerik:ChartDefaultView.ChartLegend> <telerik:ChartLegend Visibility="Collapsed" /> </telerik:ChartDefaultView.ChartLegend> <telerik:ChartDefaultView.ChartArea> <telerik:ChartArea EnableAnimations="False" LabelFormatBehavior="None" SmartLabelsEnabled="False" Background="White" > <telerik:ChartArea.AxisY> <telerik:AxisY AutoRange="False" MinValue="0" MaxValue="260" AxisLabelsVisibility="Visible" StripLinesVisibility="Hidden" MinorTicksVisibility="Visible" MajorTicksVisibility="Visible" Visibility="Visible" /> </telerik:ChartArea.AxisY> <telerik:ChartArea.AxisX > <telerik:AxisX IsDateTime="False" AxisLabelsVisibility="Visible" MajorTicksVisibility="Visible" Visibility="Visible" AutoRange="False" MinValue="0" MaxValue="720" /> </telerik:ChartArea.AxisX> <telerik:ChartArea.ZoomScrollSettingsX> <telerik:ZoomScrollSettings ScrollMode="None" /> </telerik:ChartArea.ZoomScrollSettingsX> </telerik:ChartArea> </telerik:ChartDefaultView.ChartArea> </telerik:ChartDefaultView> </telerik:RadChart.DefaultView> <telerik:RadChart.SeriesMappings> <telerik:SeriesMapping> <telerik:SeriesMapping.SeriesDefinition> <telerik:LineSeriesDefinition ShowPointMarks="False" ShowItemLabels="False"> <telerik:LineSeriesDefinition.Appearance> <telerik:SeriesAppearanceSettings Fill="Green" Foreground="Green" Stroke="Green" StrokeThickness="1" /> </telerik:LineSeriesDefinition.Appearance> </telerik:LineSeriesDefinition> </telerik:SeriesMapping.SeriesDefinition> <telerik:SeriesMapping.ItemMappings> <telerik:ItemMapping FieldName="YValue" DataPointMember="YValue" /> <telerik:ItemMapping FieldName="Index" DataPointMember="XValue" /> </telerik:SeriesMapping.ItemMappings> </telerik:SeriesMapping> </telerik:RadChart.SeriesMappings> </telerik:RadChart> </Grid>
128 |
124 |
119 |
118 |
118 |
118 |
119 |
119 |
119 |
119 |
119 |
119 |
119 |
120 |
120 |
120 |
120 |
120 |
120 |
120 |
120 |
121 |
121 |
121 |
121 |
121 |
121 |
121 |
121 |
121 |
121 |
121 |
121 |
123 |
127 |
128 |
127 |
123 |
121 |
121 |
121 |
121 |
121 |
121 |
121 |
118 |
131 |
157 |
161 |
121 |
114 |
120 |
119 |
119 |
120 |
120 |
120 |
120 |
120 |
120 |
120 |
120 |
121 |
124 |
127 |
128 |
129 |
130 |
131 |
132 |
132 |
So attached are 2 screens, one showing when I run with persistence and the other running without it... ShowColumnFooters is checked on cause I need it for column totals. Don't like when it stops working for some strange reason... I started to think it was the way I setup my settings popup for GridView but then I realized that it turns out to be when its loading settings for the Grid in code-behind. I am actually not doing anything weird, I can wipe out the Isostorage if you like in my profile to see if this causes the anomaly to go away. Its the first time I play with persistence, thought I was going to have to write my own stuff for this but ya'll did it for us.. :)
I don't do much in codebehind normally since I use MVVM for most everything but this is the one thing that I will drop in code behind when its strictly view related.