Binding to collection issue

12 posts, 0 answers
  1. Brad McBride
    Brad McBride avatar
    10 posts
    Member since:
    Feb 2010

    Posted 01 Mar 2010 Link to this post

    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 

  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 01 Mar 2010 Link to this post

    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.
  3. DevCraft banner
  4. Brad McBride
    Brad McBride avatar
    10 posts
    Member since:
    Feb 2010

    Posted 02 Mar 2010 Link to this post

    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?
  5. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 02 Mar 2010 Link to this post

    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.
  6. Brad McBride
    Brad McBride avatar
    10 posts
    Member since:
    Feb 2010

    Posted 04 Mar 2010 Link to this post

    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. 
  7. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 05 Mar 2010 Link to this post

    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.
  8. Dan
    Dan avatar
    8 posts
    Member since:
    May 2009

    Posted 11 May 2010 Link to this post

    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.
  9. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 14 May 2010 Link to this post

    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.
  10. StrandedPirate
    StrandedPirate avatar
    32 posts
    Member since:
    Nov 2007

    Posted 25 Aug 2010 Link to this post

    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.
  11. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 25 Aug 2010 Link to this post

    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
  12. Kurt
    Kurt avatar
    26 posts
    Member since:
    Mar 2009

    Posted 10 Oct 2010 Link to this post

    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.
  13. George
    Admin
    George avatar
    1332 posts

    Posted 14 Oct 2010 Link to this post

    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
Back to Top
DevCraft banner