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

.Net 3.5 embedding CoverFlow

3 Answers 66 Views
CoverFlow
This is a migrated thread and some comments may be shown as answers.
Rick
Top achievements
Rank 1
Rick asked on 09 Oct 2009, 12:24 PM
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

3 Answers, 1 is accepted

Sort by
0
Evan
Telerik team
answered on 09 Oct 2009, 02:55 PM
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.
0
Rick
Top achievements
Rank 1
answered on 24 Oct 2009, 12:59 PM
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.
0
Evan
Telerik team
answered on 12 Nov 2009, 09:13 PM
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.
Tags
CoverFlow
Asked by
Rick
Top achievements
Rank 1
Answers by
Evan
Telerik team
Rick
Top achievements
Rank 1
Share this question
or