Bugs with the selection when selecting multiple element

Thread is closed for posting
3 posts, 0 answers
  1. Sebastien
    Sebastien avatar
    7 posts
    Member since:
    Oct 2010

    Posted 11 Mar 2013 Link to this post


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

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

    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
  2. Deyan
    Deyan avatar
    2147 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.

    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. Sebastien
    Sebastien avatar
    7 posts
    Member since:
    Oct 2010

    Posted 13 Mar 2013 Link to this post


    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.

Back to Top