This question is locked. New answers and comments are not allowed.
I have a treeview which has three "levels" Category; SubCategories and Products. Sourced from AdventureWorks DB during the feasibility stage of the project. This treeview works as expected; expands etc (see treeviewexpanded.png). I have been trying "Drag and Drop" to a GridView which is also working as I expected. However, I do not get a Drag Cue, I have included a screen shot of the cue that I get, which is just a blue square/dot ?
The Treview Items source is an ObserveableCollection of QuoteItems declared as follows:
Product Item is declared as
The Datatemplate for the Tree is defined as follows :
The Tree View & Grid are declared as
I have trawled the help files, forums etc and downloaded a number of examples, by the way a treeview to GridView sample in the help files does not work, just produces errors, I expect this is due to some changes in the structure, but anyway that is a side issue.
I just wish to have a drag cue as per the demo(s) but it does not appear!!!
I have spent the last few days on this, changing various properties, methods etc and only managed to get the cue working, when the top level (Category) bing was changed to Name instead of Category Name, however the items(Categories) did not appear in the tree. I obviously cannot see the wood for the trees etc, anyone have a similar issue and "fixed" it.
Steve
The Treview Items source is an ObserveableCollection of QuoteItems declared as follows:
/// Quote Items, Holds the Hierarchical data setin the form of
///
/// Category
/// + SubCategory
/// -+Product
///
/// </summary>
public
class
QuoteItem
{
public
string
name {
get
;
set
; }
public
ProductCategory Category {
get
;
set
; }
public
List<ProductItem> SubCategories {
get
;
set
; }
public
bool
Selected {
get
;
set
; }
public
bool
Expanded {
get
;
set
; }
}
Product Item is declared as
public
class
ProductItem
{
public
string
name {
get
;
set
; }
public
ProductSubcategory SubCategory {
get
;
set
; }
public
List<Product> Products {
get
;
set
; }
public
bool
Selected {
get
;
set
; }
public
bool
Expanded {
get
;
set
; }
}
The Datatemplate for the Tree is defined as follows :
<!--Data template for the Product object-->
<
telerik:HierarchicalDataTemplate
x:Key
=
"ProductTemplate"
>
<
TextBlock
Text
=
"{Binding Name}"
Foreground
=
"DarkBlue"
/>
</
telerik:HierarchicalDataTemplate
>
<!--Data template for the Sub-Category object-->
<
telerik:HierarchicalDataTemplate
x:Key
=
"SubCategoryTemplate"
ItemTemplate
=
"{StaticResource ProductTemplate}"
ItemsSource
=
"{Binding Products}"
>
<
TextBlock
Text
=
"{Binding SubCategory.Name}"
/>
</
telerik:HierarchicalDataTemplate
>
<!--Data template for the Category object-->
<
telerik:HierarchicalDataTemplate
x:Key
=
"CategoryTemplate"
ItemTemplate
=
"{StaticResource SubCategoryTemplate}"
ItemsSource
=
"{Binding SubCategories}"
>
<!--<TextBlock Text="{Binding Name}" />-->
<
TextBlock
Text
=
"{Binding Category.Name}"
/>
</
telerik:HierarchicalDataTemplate
>
The Tree View & Grid are declared as
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"Auto"
/>
<
ColumnDefinition
Width
=
"*"
/>
</
Grid.ColumnDefinitions
>
<
telerik:RadBusyIndicator
IsBusy
=
"{Binding Path=TreeLoading}"
x:Name
=
"TreeViewBusyIndicator"
Grid.Column
=
"0"
>
<
telerik:RadTreeView
Grid.Column
=
"0"
x:Name
=
"ProductTree"
Margin
=
"4,5"
ItemTemplate
=
"{StaticResource CategoryTemplate}"
IsLoadOnDemandEnabled
=
"False"
IsExpandOnSingleClickEnabled
=
"True"
SelectionMode
=
"Multiple"
AllowDrop
=
"False"
IsDragDropEnabled
=
"True"
IsDragTooltipEnabled
=
"False"
>
</
telerik:RadTreeView
>
</
telerik:RadBusyIndicator
>
<
telerik:RadGridView
x:Name
=
"RoomQuoteGridView"
ShowGroupPanel
=
"False"
RowIndicatorVisibility
=
"Collapsed"
AutoGenerateColumns
=
"False"
Grid.Column
=
"1"
HorizontalAlignment
=
"Left"
telerik:RadDragAndDropManager.AllowDrop
=
"True"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Path=Name}"
IsFilterable
=
"False"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Path=ListPrice, StringFormat=\{0:c\}}"
IsFilterable
=
"False"
/>
<!--<telerik:GridViewDataColumn DataMemberBinding="{Binding ImageUrl}"/>-->
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
I have trawled the help files, forums etc and downloaded a number of examples, by the way a treeview to GridView sample in the help files does not work, just produces errors, I expect this is due to some changes in the structure, but anyway that is a side issue.
I just wish to have a drag cue as per the demo(s) but it does not appear!!!
I have spent the last few days on this, changing various properties, methods etc and only managed to get the cue working, when the top level (Category) bing was changed to Name instead of Category Name, however the items(Categories) did not appear in the tree. I obviously cannot see the wood for the trees etc, anyone have a similar issue and "fixed" it.
Steve