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

Binding to collection issue

11 Answers 129 Views
CoverFlow
This is a migrated thread and some comments may be shown as answers.
Brad McBride
Top achievements
Rank 1
Brad McBride asked on 01 Mar 2010, 02:37 PM
I am having an issue with the CoverFlow control that I think is being caused by my lack of experience with using the tool. I am using the Q4 2009 version of the tools and have created a collection of URLs that contain images that I need to have loaded into the coverflow control. The number of images changes based on options chosen by the user (what type/category of images they would like to browse). The code appears to be working but instead of seeing the images from the collection, I see a list of red X icons, one X for each image that I would expect to see loaded into the control. All of the example code that I am seeing is written in C# but I am forced to use VB in the project that I am working on. Does anyone have any documentation on how to bind to a collection using VB in order to get the various images listed are linked to different URLs to display in the control?

Here is the code that I am using.

 

cardImagesCollection = New ObservableCollection(Of String)()  
 
For Each listItem In doc.Descendants("{#RowsetSchema}row")  
     strPicPath = "http://URLADDRESS/" & listItem.Attribute("ows_RequiredField").Value  
     cardImagesCollection.Add(strPicPath)                  
Next 
 
RadCoverFlow1.ItemsSource = cardImagesCollection 

11 Answers, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 01 Mar 2010, 05:02 PM
Hello Brad,

 You could use this code converter in order to convert the examples you are interested in (or at least the code): http://converter.telerik.com/.

About the problem you are facing - could you check the addresses you are trying to fin the images at - the generated addresses might be incorrect. You could use debugging tool like Firebug (if you are using FF) or Fiddler (if you are using IE) in order to track what your application tries to download.

Hope this helps.

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
Brad McBride
Top achievements
Rank 1
answered on 02 Mar 2010, 04:47 PM
I have verified that the URI's being passed into the collection that I have bound the coverflow control to are correct and valid. I am beginning to wonder if I am using the correct method to get the functionality that I want. I have a list of images that are stored on a sharepoint site and I need to display those images using a silverlight form on a web page. The images that the user sees in the coverflow control are determined dynamically based on a category that they choose from. The code that connects to sharepoint to get the correct list of URI's based on the user choice is correct but I'm wondering if it is possible to provide just a list of URI's to the coverflow control and have it populate the images. Is there another method that I should be using other than binding to a collection of URI values that are stored as strings?
0
Miroslav Nedyalkov
Telerik team
answered on 02 Mar 2010, 05:31 PM
Hello Brad,

 You could refer to the following example - it demonstrates how to use the CoverFlow control to bind to a collection of URIs that are fetched from a web service (it uses Flickr): http://demos.telerik.com/silverlight/#CoverFlow/DataInfo.

If you still have problems with this, please open a support ticket and send us a sample project - this will help us assist you to solve the problem.

Best wishes,
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
Brad McBride
Top achievements
Rank 1
answered on 04 Mar 2010, 04:13 PM
I was able to fix the issue by upgrading to the Q1 2010 version of the controls. Apparently there have been changes made to the control that will allow me to bind to a collection of URIs and this is what I needed to do.

I am now running into another problem with the control and the examples for the Q1 2010 version don't address this scenario. The collection that I am binding to is can be updated dynamically throughout the lifespan of the application. When I first load the application and populate the collection, the coverflow control populates with images and works exactly as it is intended. However, when I attempt to change the images displayed in the coverflow by emptying the collection and refilling it with new items, when I set the itemsSource property to the collection I am getting a Null Reference Exception. The application always populates the collection and binds to it correctly the first time but as soon as I empty the collection and set the itemssource property to the collection again, I get the error. Any idea what may be causing this problem? The code below is from my project.

Dim doc As Xml.Linq.XElement = e.Result  
            Dim strPicPath As String 
 
            Me.imgInfo.Clear() ' Clear the image collection and populate new images.        
 
            For Each listItem In doc.Descendants("{#RowsetSchema}row")  
                Dim card As New cardData  
                strPicPath = "http://XXXXXXX/" & listItem.Attribute("ows_RequiredField").Value ' build the URI for the image  
                card.cardCat = selCat ' set the category for the image  
                card.cardURI = New Uri(strPicPath, UriKind.Absolute) ' set the URI for the image  
                imgInfo.Add(card) ' add the card object to the collection  
            Next 
 
            cardCoverFlow.ItemsSource = imgInfo 'This command works the first time it is run but throws an exception if the code runs a subsequent time. 
0
Miroslav Nedyalkov
Telerik team
answered on 05 Mar 2010, 04:23 PM
Hi Brad,

 I couldn't reproduce this issue at my side. Could you please send us a sample project that reproduces the issue? This would help us a lot finding what the problem is.

As a suggestion - you could use an ObservableCollection and not set the ItemsSource again, but in my opinion this couldn't be causing the problem.

Sincerely yours,
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
Dan
Top achievements
Rank 1
answered on 11 May 2010, 07:41 PM
I have effectively the same experience with the Silverlight q1 2010 release where removing items from the collection or clear it before repopulating with different items causes the coverflow to render no content.
If i repopulate the collection again later with the orginal content, it will render
If i add additional items to the collection without removing those already rendered by the coverflow, the new items will render.
0
Valeri Hristov
Telerik team
answered on 14 May 2010, 08:12 AM
Hi Dan,

Could you please, open a new support ticket and send us a simple application that could be used to observe the problem?

Sincerely yours,
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
StrandedPirate
Top achievements
Rank 1
answered on 25 Aug 2010, 08:45 AM
What was the outcome of this? I'm having the same issue with the RadTreeView. See the post here: http://www.telerik.com/community/forums/silverlight/treeview/observablecollection-and-loadondemand.aspx

Calling Clear() or RemoveAll() extension method on an ObservableCollection causes the treeview to also not behave correctly.
0
Valeri Hristov
Telerik team
answered on 25 Aug 2010, 10:09 AM
Hello Joey,

As far as I can remember, this problem was caused by a bug in RadCoverFlow, when the control is in virtualizing mode. Recently the RadTreeView virtualization was reworked and I guess the behavior you are seeing might be related to a bug. As usual, sending a simple application that could be used to observe the problem is the best way to find a solution.

Sincerely yours,
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
Kurt
Top achievements
Rank 1
answered on 10 Oct 2010, 07:01 AM
I just thought I'd chime in... I don't think the reply of "you could always use a converter...." is very helpful.  50% of developers are VB.Net developers.  Having the examples (for every Telerik product) default to C# is annoying enough, but suggesting that we have to convert the examples is a bit odd to me.  Why the extra step for us?  Mind you, the code examples have been recently updated to mostly include VB.Net now, but I have yet to find a Silverlight video that isn't C#.  That makes an entire section of what could be useful information on your website, utterly useless to half of us.  

Your controls are still the best in the industry.  Here's to hoping your tutorials catch up.
0
George
Telerik team
answered on 14 Oct 2010, 09:18 AM
Hello Kurt,

Thank you for your feedback. We will take this in our next discussion in order to improve our examples and support for VB.NET developers.

Please do not hesitate to contact us if you require any further information.

Best wishes,
George
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
Tags
CoverFlow
Asked by
Brad McBride
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Brad McBride
Top achievements
Rank 1
Dan
Top achievements
Rank 1
Valeri Hristov
Telerik team
StrandedPirate
Top achievements
Rank 1
Kurt
Top achievements
Rank 1
George
Telerik team
Share this question
or