This is a migrated thread and some comments may be shown as answers.

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

4 Answers 123 Views
CoverFlow
This is a migrated thread and some comments may be shown as answers.
Salvador
Top achievements
Rank 1
Salvador asked on 10 Sep 2010, 12:04 AM
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.

4 Answers, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 10 Sep 2010, 12:39 PM
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
0
Salvador
Top achievements
Rank 1
answered on 10 Sep 2010, 04:17 PM
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.
0
Valeri Hristov
Telerik team
answered on 13 Sep 2010, 10:12 AM
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
0
Salvador
Top achievements
Rank 1
answered on 16 Sep 2010, 03:01 PM
I did that you recomend but does not work!!!

I resolved the problem. 

Thanks.
Tags
CoverFlow
Asked by
Salvador
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Salvador
Top achievements
Rank 1
Valeri Hristov
Telerik team
Share this question
or