Selected Item?

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

    Posted 02 Nov 2010 Link to this post

    Whats the code to have the item selected on the InfiniteListBox?

    I have:
    radInfiniteLIstBox  is my listbox populated by your example items
    resultText  is Textblock showing the result string of the selection.

    This code works with regular Listbox, but not with there a logic error or are things handled differently?


     private void radInfiniteListBox_SelectionChanged_1(object sender, SelectionChangedEventArgs e)
                object item = radInfiniteListBox.SelectedItem;
                InfiniteListBoxItem listboxItem = item as InfiniteListBoxItem;

                if (listboxItem == null)
                    resultText.Text = "No item currently selected.";
                    resultText.Text = listboxItem.Content.ToString();
  2. Brian
    Brian avatar
    4 posts
    Member since:
    Sep 2010

    Posted 03 Nov 2010 Link to this post

    I have the exact same issue.  When I handle the SelectionChanged event all I see is the item that is currently selected.  How do I know if the event has been fired because of a flick or scroll vs selection?  Sorry for my ignorance I am pretty new to Silverlight.

    Glad you decided to bring out Mobile Controls!
  3. Georgi
    Georgi avatar
    296 posts

    Posted 03 Nov 2010 Link to this post

    Hi guys,

    Thank you for your feedback - it is most welcome and appreciated.

    The RadInfiniteListBox behaves a bit differently when it comes about selection. Since it loops a rangle of logical items simply setting the SelectedItem will not do the job. Instead you should call the following method which will set the specified logical index as Selected and will center the item associated with it within the list:


    Still, the method name is a bit confusing and we will update it for our next CTP, it should be something like SelectAndCenterLogicalIndex.

    Please, note that we will also expose the more flexible and fast RadLoopingList control. It is currently used internally by our Date/Time pickers and is not polished for public use but we have plans to update it.

    RadInfiniteListBox does not provide a convenient way to determine the reason for a selection change. This however is implemented in our RadLoopingList, which, as I mentioned, will be publicly available for our next CTP.

    All the best,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top