.Net 3.5 embedding CoverFlow

4 posts, 0 answers
  1. Rick
    Rick avatar
    12 posts
    Member since:
    Oct 2006

    Posted 09 Oct 2009 Link to this post

    I have a full blown .Net 3.5 business application that now requires a CoverFlow control. Does anyone have a working code example of embedding the Silverlight CoverFlow control into a .Net 3.5 web application? An example where clicking on the CoverFlow will return the index back to the web application is what I am looking for.

    Thanks,
    Rick
  2. Evan
    Admin
    Evan avatar
    13 posts

    Posted 09 Oct 2009 Link to this post

    Hello Rick,

    Here is a quick example of this functionality.  In the easiest scenario, you know the name of the html element that you want to send the value to, so when the SelectionChanged event fires on RadCoverFlow it sends that index to the control.  The code for that is pretty straightforward once you get used to interacting with the DOM from Silverlight:

    private void xCoverFlow_SelectionChanged(object sender, SelectionChangedEventArgs e)
    {
        HtmlDocument htmlDoc = HtmlPage.Document;
        HtmlElement htmlElement = htmlDoc.GetElementById("Input");
        htmlElement.SetAttribute("value", xCoverFlow.SelectedIndex.ToString());
    }
    *(the input box on the aspx page has an ID of Input).

    This was built with the Q3 Beta 1 dlls, but the concept is the same going back to Silverlight 2.  I've attached the project so you can check it out and use it as an example to get you started.

    Best wishes,
    Evan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
  4. Rick
    Rick avatar
    12 posts
    Member since:
    Oct 2006

    Posted 24 Oct 2009 Link to this post

    That is awesome thank you. Now my intent is to set a selected row in a GridView using the index from the Silverlight object.

    My question now is: How do I do this the other way around. I have selected a row in my GridView and I want to use the Index value to choose an index in my Silverlight coverflow.
  5. Evan
    Admin
    Evan avatar
    13 posts

    Posted 12 Nov 2009 Link to this post

    Hi Rick,

    Sorry for the delayed response, the Q3 release and events schedule has been hectic but I didn't want you to think we forgot about you.

    In order to do this, you would cover operations through calling a HtmlPage.Window.Invoke to send data back to the client through pre-defined Javascript functions, and when the client index changes you are able to call the Silverlight plugin by identifying the plugin, calling into a ScriptableMember in our Silverlight code, and letting that handle the change in the plugin. 

    Check out the attached project and let me know if you have any other questions. 

    Regards,
    Evan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top