Move radcoverflow to specific image (value) base on SelectedItem?

5 posts, 0 answers
  1. Salvador
    Salvador avatar
    4 posts
    Member since:
    Sep 2010

    Posted 09 Sep 2010 Link to this post

    I have a radcoverflow control wich is binding a collection items. (I named PhotoInfo to each item in the collection for explanation purpose)
    It looks and works fine, but I want to do this: After the collection is loaded by the control I want to set PhotoInfo object value to the control and that control show (move) to this value.  Is possible? 

    Thank you for your help.
  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 10 Sep 2010 Link to this post

    Hi Salvador,

     You could use the SelectedItem property of the CoverFlow control if you need to provide a reference to the object to be selected, or the SelectedIndex property if you prefer to select the item by index.

    Kind regards,
    Miroslav Nedyalkov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Salvador
    Salvador avatar
    4 posts
    Member since:
    Sep 2010

    Posted 10 Sep 2010 Link to this post

    Thank you,

    I using the selecteditem property to set the object that i want to select (move) in the collection, but does no work.  the selected index works but I don´t know which index correspond in the collection with my object, 

    I using the "Data Info" example from your web site, and I just add a Button to create an object ans set into SelecteItem.

            private void btnSetValue_Click(object sender, System.Windows.RoutedEventArgs e)
            {
                ImageInfo imgInfo = new ImageInfo();

                imgInfo.Image = "http://farm5.static.flickr.com/4002/4514341292_e12f178ec5_o.jpg";
                imgInfo.Link = "http://www.flickr.com/people/snikfeed/";
                imgInfo.Title = "snik feed Index=10";

                coverFlow.SelectedItem = imgInfo;

                //coverFlow.SelectedIndex = 6; //This works
            }


    Thank you.
  5. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 13 Sep 2010 Link to this post

    Hello Salvador,

    I think that if you override the Equals() method of the ImageInfo class, the CoverFlow will be able to properly select the provided item. The problem is that generally the class instances are compared by reference and when you create a new instance (new ImageInfo()...) it has different reference than the items inside the CoverFlow. If you override the Equals() method to compare the members of the ImageInfo class, the instances will be compared differently and the selection will work.

    Regards,
    Valeri Hristov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Salvador
    Salvador avatar
    4 posts
    Member since:
    Sep 2010

    Posted 16 Sep 2010 Link to this post

    I did that you recomend but does not work!!!

    I resolved the problem. 

    Thanks.
Back to Top
DevCraft banner