DragInitializeEventArgs.DragVisual
public
class
PsuedoClass
{
public
IObservableCollection<IBaseClass> Parents {
get
;
set
; }
}
public
class
Parent : IBaseClass
{
public
String Name {
get
;
set
; }
public
IObservableCollection<IBaseClass> Children {
get
;
set
; }
public
IDictionary<
string
,
string
> OtherData {
get
;
set
; }
}
public
class
Child : IBaseClass
{
public
String Name {
get
;
set
; }
}
public
interface
IBaseClass
{
String Name {
get
;
set
; }
}
<
UserControl
... >
<
UserControl.Resources
>
<
DataTemplate
x:Key
=
"ChildItemTemplate"
>
<
TextBlock
Text
=
"{Binding Name}"
/>
</
DataTemplate
>
<
HierarchicalDataTemplate
x:Key
=
"ParentItemTemplate"
ItemsSource
=
"{Binding Children}"
ItemTemplate
=
"{StaticResource ChildItemTemplate}"
>
<
TextBlock
Text
=
"{Binding Name}"
/>
<
SomeHowDisplayTheRestOfTheColumns
/>
</
HierarchicalDataTemplate
>
</
UserControl.Resources
>
<
telerik:RadTreeListView
ItemsSource
=
"{Binding Parents}"
Columns
=
"{Binding SomePropertyThatExposesOurColumns}"
ItemTemplate
=
"{StaticResource ParentItemTemplate}"
>
</
telerik:RadTreeListView
>
</
UserControl
>
Hi,
Jag have an existing Custom Theme for RadGridView which is not entire correct because in
<ControlTemplate x:Key="GridViewGroupPanelItemTemplate" TargetType="grid:GridViewGroupPanelItem">
Content="{Binding Path=DisplayContent}" doesn't get any value. I think it something is missing in our GridViewTheme.xaml. Would be very grateful for any tip.
Best regards
Elena
<ControlTemplate x:Key="GridViewGroupPanelItemTemplate" TargetType
="grid:GridViewGroupPanelItem">
<StackPanel x:Name="PART_GroupPanelItemStackPanel" Orientation="Horizontal"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Background="Transparent">
<Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment }">
<Grid.RowDefinitions>
<RowDefinition MinHeight="4" Height ="Auto" /> <RowDefinition />
</Grid.RowDefinitions>
<Path Name="PART_InsertionPoint" Grid.Row="0" Visibility="Collapsed"
Fill="{StaticResource GridView_IndicatorPrimaryColor}" Stretch="Fill"
VerticalAlignment="Top" HorizontalAlignment="Center" Width="6.414"
Height="4.677"
Data="M206.66812,170.31108 L212.08199,170.31108 209.36058,173.98834 z" />
<Grid x:Name="PART_ConnectingLine" Visibility="Visible" Grid.Row="1"
Margin="{TemplateBinding Padding}">
<Path Fill="{StaticResource GridView_IndicatorSecondaryColor}"
Stretch="Fill" Stroke="{x:Null}" Width="4" Height="7" Margin="1,2,0,0"
Data="M0,0 L1,0 1,1 2,1 2,2 3,2 3,3 4,3 4,4 3,4 3,5 2,5 2,6 1,6 1,7 0,7 z"/>
<Path Fill="{StaticResource GridView_IndicatorPrimaryColor}" Stretch="Fill"
Stroke="{x:Null}" Width="4" Height="7"
Data="M0,0 L1,0 1,1 2,1 2,2 3,2 3,3 4,3 4,4 3,4 3,5 2,5 2,6 1,6 1,7 0,7 z"/>
</Grid>
</Grid>
<Border BorderBrush="{StaticResource GridView_HeaderInnerBorder}"
Background="{TemplateBinding Background}" BorderThickness="1" CornerRadius="3"
Margin="5,0">
<grid:GridViewGroupPanelCell Background="Transparent" BorderThickness="0"
Content="{Binding Path=DisplayContent}" Foreground="Black" Padding="12,0,12,2"
SortDirection="{Binding Path=SortDirection}"/>
</Border>
</StackPanel>
</ControlTemplate
Private
_selectedItem
As
Library.EmployeeInfo
Public
Property
SelectedItem
As
Library.EmployeeInfo
Get
Return
_selectedItem
End
Get
Set
(
ByVal
value
As
Library.EmployeeInfo)
If
IsBusy
Then
Return
_selectedItem = value
NotifyOfPropertyChange(
Function
() SelectedItem)
Events.Publish(
New
SelectionChangedEvent(Of EmployeeListViewModel, Library.EmployeeInfo)
With
{.Source =
Me
, .Obj =
Me
.SelectedItem})
End
Set
End
Property
<
Grid.Resources
>
<
bengenconv:SingleCharacterConverter
x:Key
=
"SingleCharacterConverter"
/>
<
CollectionViewSource
x:Key
=
"Emps"
Source
=
"{Binding Model}"
>
<
CollectionViewSource.SortDescriptions
>
<
componentModel:SortDescription
PropertyName
=
"Lastname"
/>
<
componentModel:SortDescription
PropertyName
=
"Firstname"
/>
<
componentModel:SortDescription
PropertyName
=
"EmployeeIdNumber"
/>
</
CollectionViewSource.SortDescriptions
>
<
CollectionViewSource.GroupDescriptions
>
<
PropertyGroupDescription
PropertyName
=
"Lastname"
Converter
=
"{StaticResource SingleCharacterConverter}"
/>
</
CollectionViewSource.GroupDescriptions
>
</
CollectionViewSource
>
<
DataTemplate
x:Key
=
"EmployeeTemplate"
>
<
TextBlock
>
<
TextBlock.Text
>
<
MultiBinding
StringFormat
=
"{}{0}, {1}"
>
<
Binding
Path
=
"Lastname"
/>
<
Binding
Path
=
"Firstname"
/>
</
MultiBinding
>
</
TextBlock.Text
></
TextBlock
>
</
DataTemplate
>
<
HierarchicalDataTemplate
x:Key
=
"GroupsTemplate"
ItemsSource
=
"{Binding Items}"
ItemTemplate
=
"{StaticResource EmployeeTemplate}"
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
TextBlock
Text
=
"{Binding Name}"
/>
<
TextBlock
Text
=
"{Binding ItemCount, StringFormat=' ({0})'}"
FontSize
=
"11"
FontStyle
=
"Italic"
Foreground
=
"DimGray"
VerticalAlignment
=
"Center"
/>
</
StackPanel
>
</
HierarchicalDataTemplate
>
</
Grid.Resources
>
<
telerik:RadTreeView
x:Name
=
"xTreeView"
ItemsSource
=
"{Binding Source={StaticResource Emps}, Path=Groups}"
Grid.Row
=
"1"
Padding
=
"5"
BorderThickness
=
"0"
IsEditable
=
"False"
SelectionMode
=
"Single"
SelectedItem
=
"{Binding SelectedItem, Mode=TwoWay}"
ItemTemplate
=
"{StaticResource GroupsTemplate}"
IsSingleExpandPath
=
"True"
IsExpandOnSingleClickEnabled
=
"True"
>
</
telerik:RadTreeView
>
</
Grid
>