Hi,
I am new with telerik controls and I am using RadMediaPlayer. I added a grid with one column where I will display the chapters. I can jump to any position in the Player when I click one of the row of the grid and what I want now is depending on the Position highlight the row in the grid. I tried using the ChapterReached event but didn't do anything. Could you tell me what event should I use to get what I want?
Thanks.
I am new with telerik controls and I am using RadMediaPlayer. I added a grid with one column where I will display the chapters. I can jump to any position in the Player when I click one of the row of the grid and what I want now is depending on the Position highlight the row in the grid. I tried using the ChapterReached event but didn't do anything. Could you tell me what event should I use to get what I want?
Thanks.
6 Answers, 1 is accepted
0
Hello Juan,
I am not sure if i understand your scenario completely but basically when you reach a chapter it gets selected. And the default style of the RadMediaChapter element describes a selection state and you can change it to better fit your requirements.
I attached a sample solution to demonstrate this approach, please have a look at the it and let me know if it works for you.
Kind regards,
Tina Stancheva
the Telerik team
I am not sure if i understand your scenario completely but basically when you reach a chapter it gets selected. And the default style of the RadMediaChapter element describes a selection state and you can change it to better fit your requirements.
I attached a sample solution to demonstrate this approach, please have a look at the it and let me know if it works for you.
Kind regards,
Tina Stancheva
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Juan
Top achievements
Rank 1
answered on 26 Oct 2011, 04:06 PM
Hello Tina,
What I need is that when the the chapter is reached, I can have an event that is triggered in order to get the time of the chapter and highlight the row in the grid. As I told you before, I thought of ChapterReached event but this one is not executing.
Regards,
Juan
What I need is that when the the chapter is reached, I can have an event that is triggered in order to get the time of the chapter and highlight the row in the grid. As I told you before, I thought of ChapterReached event but this one is not executing.
Regards,
Juan
0
Hi Juan,
Thank you for getting back to us. Can you please elaborate on the issue with the ChapterReached event, because in the sample project I sent you can handle the ChapterReached event and you can get the position from the arguments - (e.OriginalSource as RadMediaItem).Position and then use it to implement your scenario.
Doesn't that work for you and if not can you please modify my solution to better illustrate your scenario. Thank you in advance for your cooperation.
All the best,
Tina Stancheva
the Telerik team
Thank you for getting back to us. Can you please elaborate on the issue with the ChapterReached event, because in the sample project I sent you can handle the ChapterReached event and you can get the position from the arguments - (e.OriginalSource as RadMediaItem).Position and then use it to implement your scenario.
Doesn't that work for you and if not can you please modify my solution to better illustrate your scenario. Thank you in advance for your cooperation.
All the best,
Tina Stancheva
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Juan
Top achievements
Rank 1
answered on 22 Nov 2011, 08:26 PM
Hi Tina,
Thank you very much for your answer. I could finally get the ChapterReached event but I still don't know how to jump in the Gridview to the selected chapter. Attached you have an image about the design. My goal is that when a chapter is reached then highlight the corresponding one in the Gridview. Can you help me with this one?
Thank you very much for your answer. I could finally get the ChapterReached event but I still don't know how to jump in the Gridview to the selected chapter. Attached you have an image about the design. My goal is that when a chapter is reached then highlight the corresponding one in the Gridview. Can you help me with this one?
private void OnDemand_ChapterReached(object sender, Telerik.Windows.RadRoutedEventArgs e)
{
TimeSpan tsPosition = (e.OriginalSource as RadMediaItem).Position;
//Code to highlight the row that has the same position as tsPosition
}
Let me know if you need more info.
Regards,
Juan
0
Hi Juan,
You can get the reached chapter like so:
But a better approach would be to bind the SelectedIndex of the ListBox control that displays the chapters:
I attached a sample project to demonstrate this approach - please note how the two way binding works in both directions.
Best wishes,
Tina Stancheva
the Telerik team
You can get the reached chapter like so:
private
void
player_ChapterReached(
object
sender, Telerik.Windows.RadRoutedEventArgs e)
{
RadMediaItem item = e.OriginalSource
as
RadMediaItem;
RadMediaChapter reachedChapter = item.SelectedItem
as
RadMediaChapter;
}
<
ListBox
x:Name
=
"Chapters"
SelectedIndex
=
"{Binding ElementName=player, Path=SelectedItem.SelectedIndex, Mode=TwoWay}"
>
<
ListBoxItem
Content
=
"Chapter 1"
/>
<
ListBoxItem
Content
=
"Chapter 2"
/>
<
ListBoxItem
Content
=
"Chapter 3"
/>
</
ListBox
>
I attached a sample project to demonstrate this approach - please note how the two way binding works in both directions.
Best wishes,
Tina Stancheva
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Juan
Top achievements
Rank 1
answered on 02 Dec 2011, 07:32 PM
Hi Tina,
Thank you very much for your help. That worked great for me.
Regards,
Juan
Thank you very much for your help. That worked great for me.
Regards,
Juan