Allow multi selection in RadCarousel

2 posts, 0 answers
  1. Grégoire
    Grégoire avatar
    18 posts
    Member since:
    Apr 2011

    Posted 06 May 2014 Link to this post

    Hi,

    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
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 07 May 2014 Link to this post

    Hello Grégoire,

    Currently, RadCarousel does not support multiple selection. I have logged this functionality as a feature request in our Feedback Portal (Multiple selection in RadCarousel) so that you and other customers can vote for it and follow its progress.  

    Regards,
    Maya
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top