Hi,
I am struggeling for hours now to implement the multi selection in the carousel. I tried several ways, the last being this one :
But it acts as if the RadCarousel SelectedItems property is deactivated.
Do you have any idea how I could do this?
Thank you,
Grégoire
I am struggeling for hours now to implement the multi selection in the carousel. I tried several ways, the last being this one :
<
Style
TargetType
=
"{x:Type telerik:CarouselItem}"
>
<
Setter
Property
=
"Background"
Value
=
"AliceBlue"
/>
<!--#50FFFFCC-->
<
Setter
Property
=
"BorderBrush"
Value
=
"Transparent"
/>
<
Setter
Property
=
"BorderThickness"
Value
=
"1"
/>
<
Setter
Property
=
"Height"
Value
=
"{Binding ItemHeight, RelativeSource={RelativeSource AncestorType={x:Type local:ILCarousel}}}"
/>
<
Setter
Property
=
"Width"
Value
=
"{Binding ItemWidth, RelativeSource={RelativeSource AncestorType={x:Type local:ILCarousel}}}"
/>
<
Setter
Property
=
"Template"
>
<
Setter.Value
>
<
ControlTemplate
TargetType
=
"{x:Type telerik:CarouselItem}"
>
<
Border
BorderThickness
=
"2"
CornerRadius
=
"2"
Padding
=
"5"
Background
=
"{TemplateBinding Background}"
BorderBrush
=
"#FFB8D6FB"
>
<
Grid
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"Auto"
/>
<
ColumnDefinition
Width
=
"*"
/>
<
ColumnDefinition
Width
=
"Auto"
/>
<
ColumnDefinition
Width
=
"*"
/>
<
ColumnDefinition
Width
=
"Auto"
/>
</
Grid.ColumnDefinitions
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"*"
/>
</
Grid.RowDefinitions
>
<
local:ILScrollViewer
HorizontalScrollBarVisibility
=
"Auto"
VerticalScrollBarVisibility
=
"Auto"
x:Name
=
"content"
Grid.ColumnSpan
=
"3"
>
<
ContentPresenter
Name
=
"PART_presenter"
/>
</
local:ILScrollViewer
>
<
CheckBox
Grid.Column
=
"0"
IsChecked
=
"{Binding IsSelected, RelativeSource={RelativeSource TemplatedParent}}"
>
<
CheckBox.Visibility
>
<
MultiBinding
Converter
=
"{StaticResource and}"
>
<
Binding
Path
=
"SelectionMode"
Converter
=
"{StaticResource visibleIfNotEquals}"
ConverterParameter
=
"{x:Static SelectionMode.Single}"
RelativeSource
=
"{RelativeSource AncestorType={x:Type local:ILCarousel}}"
/>
<
Binding
Path
=
"IsCurrent"
RelativeSource
=
"{RelativeSource TemplatedParent}"
Converter
=
"{StaticResource not}"
/>
</
MultiBinding
>
</
CheckBox.Visibility
>
</
CheckBox
>
<
CheckBox
Grid.Column
=
"2"
IsChecked
=
"{Binding IsSelected, RelativeSource={RelativeSource TemplatedParent}}"
>
<
CheckBox.Visibility
>
<
MultiBinding
Converter
=
"{StaticResource and}"
>
<
Binding
Path
=
"SelectionMode"
Converter
=
"{StaticResource visibleIfNotEquals}"
ConverterParameter
=
"{x:Static SelectionMode.Single}"
RelativeSource
=
"{RelativeSource AncestorType={x:Type local:ILCarousel}}"
/>
<
Binding
Path
=
"IsCurrent"
RelativeSource
=
"{RelativeSource TemplatedParent}"
/>
</
MultiBinding
>
</
CheckBox.Visibility
>
</
CheckBox
>
<
CheckBox
Grid.Column
=
"4"
IsChecked
=
"{Binding IsSelected, RelativeSource={RelativeSource TemplatedParent}}"
>
<
CheckBox.Visibility
>
<
MultiBinding
Converter
=
"{StaticResource and}"
>
<
Binding
Path
=
"SelectionMode"
Converter
=
"{StaticResource visibleIfNotEquals}"
ConverterParameter
=
"{x:Static SelectionMode.Single}"
RelativeSource
=
"{RelativeSource AncestorType={x:Type local:ILCarousel}}"
/>
<
Binding
Path
=
"IsCurrent"
RelativeSource
=
"{RelativeSource TemplatedParent}"
Converter
=
"{StaticResource not}"
/>
</
MultiBinding
>
</
CheckBox.Visibility
>
</
CheckBox
>
</
Grid
>
</
Border
>
</
ControlTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
But it acts as if the RadCarousel SelectedItems property is deactivated.
Do you have any idea how I could do this?
Thank you,
Grégoire