RadJumpList - no SelectedIndex

4 posts, 0 answers
  1. Heather
    Heather avatar
    3 posts
    Member since:
    Oct 2011

    Posted 05 Oct 2011 Link to this post

    I have recently converted a ListBox control which is bound to MVVM data into a RadJumpList. To my surprise there is no SelectedIndex property associated with the RadJumpBox control. I am leveraging the item index in a navigation query to a second page in order to return a detail view of the selected item. With no SelectedIndex property for this JumpList how can I capture the selected item information?
  2. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 06 Oct 2011 Link to this post

    Hello Heather,

    Thanks for writing and for your question.

    There is a SelectedItem property which returns the business object from the source collection that is currently selected. You can use this property to obtain information about the current selection in RadDataBoundListBox/RadJumpList.

    Let me know if you need further assistance with this.

    Greetings,
    Deyan
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
  4. Heather
    Heather avatar
    3 posts
    Member since:
    Oct 2011

    Posted 06 Oct 2011 Link to this post

    I resolved this by leveraging the following

    // Handle selection changed on ListBox
    private void MainListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
    {
        if (MainListBox.SelectedItem != null)
        {
            var selectedIndex = (MainListBox.SelectedItem as ItemViewModel).LineSix;
     
            // Navigate to the new page
            NavigationService.Navigate(new Uri("/DetailsPage.xaml?selectedItem=" + selectedIndex, UriKind.Relative));
        }
    }
  5. Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 06 Oct 2011 Link to this post

    Hi Heather,

    Yes, this is the right approach when using the SelectedItem property.

    Let me know if you need further assistance with this.

    All the best,
    Deyan
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top