Bugs with the selection when selecting multiple element

3 posts, 0 answers
  1. Sebastien
    Sebastien avatar
    7 posts
    Member since:
    Oct 2010

    Posted 11 Mar 2013 Link to this post

    Hello,

    I have a simple list with a small DataTemplate (Image + Text):

    <telerikPrimitives:RadDataBoundListBox Grid.Row="2"
                                                           EmptyContent=""
                                                           Margin="12,0,0,0"
                                                           ItemsSource="{Binding Spotlights}"
                                                           SelectedItem="{Binding SelectedSpotlight, Mode=TwoWay}"
                                                           x:Name="ListSpotlights">
     
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="SelectionChanged">
                                <cal:ActionMessage MethodName="SelectApplication">
                                    <cal:Parameter Value="{Binding SelectedItem, ElementName=ListSpotlights}" />
                                </cal:ActionMessage>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
     
                        <telerikPrimitives:RadDataBoundListBox.ItemTemplate>
                            <DataTemplate>
     
                                <Grid Margin="{Binding IsLastItem, Converter={StaticResource SpotlightItemMarginConverter}}">
     
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="*" />
                                    </Grid.ColumnDefinitions>
     
                                    <Image Width="99"
                                           Height="99"
                                           Source="{Binding ImageUrl}"
                                           VerticalAlignment="Top" />
     
                                    <TextBlock Grid.Column="1"
                                               FontSize="{StaticResource PhoneFontSizeLarge}"
                                               FontFamily="{StaticResource PhoneFontFamilyLight}"
                                               Margin="12,0,0,0"
                                               MaxHeight="90"
                                               Text="{Binding Name}"
                                               TextWrapping="Wrap"
                                               VerticalAlignment="Center" />
     
                                </Grid>
     
                            </DataTemplate>
                        </telerikPrimitives:RadDataBoundListBox.ItemTemplate>
     
                    </telerikPrimitives:RadDataBoundListBox>

    I'm using the standard OS theme color for my app (so it will be displayed nice with dark and light themes).

    The RadDataListBox is missing a property like SelectionMode (None, Single, Multi). When I click on a item, I'm launching a page. I was observing that when coming back to the list and selecting the same item again, it didn't work. I found another thread where you suggest to set the SelectedItem to null. It works, but it does not reset the color of the selected item, it seems a bug.

    The second bug is closely related to the previous one: if I select other items, the text uses again the theme color, so I can have in my list 4 items with the red color by example.

    Thank you
    ArchieCoder
  2. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 13 Mar 2013 Link to this post

    Hello Sebastien,

    Thanks for writing.

    I am not quite sure why are you using the SelectionChanged event to navigate to another page. You can simply handle the ItemTap event which is fired each time the user taps on an item. If you want to disable the selection color for the visual items, you can either handle the SelectionChanging event and cancel the selection or simply override the foreground color within your Item Template.

    I hope this helps.

    Greetings,
    Deyan
    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  3. DevCraft banner
  4. Sebastien
    Sebastien avatar
    7 posts
    Member since:
    Oct 2010

    Posted 13 Mar 2013 Link to this post

    Hi,

    Thank you for the answer. In fact, using ItemTap fixed both problems! I was not aware of this event, I was used to SelectionChanged with WP lists.

    Regards
    ArchieCoder
Back to Top