jeewan thapa
Top achievements
Rank 1
jeewan thapa
asked on 24 Feb 2009, 05:12 PM
Hi,
I have a button inside a stack panel in a carousel control and I want to fire a click event in that button but It does nothing.
Can you please help? I am try to pop up another window when user click on a button ( details of that particular selected item) . Moreover how do I get the ID of a selected item.
Thank you
Jeewan Thapa
I have a button inside a stack panel in a carousel control and I want to fire a click event in that button but It does nothing.
Can you please help? I am try to pop up another window when user click on a button ( details of that particular selected item) . Moreover how do I get the ID of a selected item.
Thank you
Jeewan Thapa
3 Answers, 1 is accepted
0
Hello jeewan thapa,
There is a know bug in RadCarousel that renders all elements inside a CarouselItem inactive. This bug has been fixed and the fix wll be included in our upcoming release. Actually the bug is only present in our default themes and if you define a custom style for CarouselItem it will not be a problem.
I am sending you a sample project that demontrates how you can add buttons to the carousel items, and how you can get the ID of a selected item.
All the best,
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Maria Im
Top achievements
Rank 1
answered on 02 Nov 2009, 07:07 PM
This is what I also found. I don't think it really has to do something with the original carousel theme. You just need to change one property to true. So I have all my styles from the original theme except the fact that "IsHitTestVisble" under the CarouselDataRecordPresenter was set to false. So i could never hit any other control under it. Once I set that property to True. I was able to raise the ClickEvents for each of my buttons in the carousel.
Hope that helps someone.
Hope that helps someone.
<Style TargetType="{x:Type telerik:CarouselDataRecordPresenter}"> |
<Setter Property="OverridesDefaultStyle" Value="true"/> |
<Setter Property="Template"> |
<Setter.Value> |
<ControlTemplate TargetType="{x:Type telerik:CarouselDataRecordPresenter}"> |
<Grid IsHitTestVisible="True" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> |
<Grid.RowDefinitions> |
<RowDefinition Height="30" /> |
<RowDefinition Height="*" /> |
<RowDefinition Height="Auto" /> |
</Grid.RowDefinitions> |
<StackPanel Grid.Row="0" Orientation="Horizontal" VerticalAlignment="Center" > |
<Button x:Name="xxxxx" Content="test" Click="xxxxx_Click"></Button> |
</StackPanel> |
<Rectangle Grid.Row="1" RadiusX="3" RadiusY="3" Width="260" Height="350"> |
<Rectangle.Fill> |
<ImageBrush x:Name="brush" ImageSource="Afro.jpg"/> |
</Rectangle.Fill> |
</Rectangle> |
<StackPanel Grid.Row="2" Orientation="Horizontal" VerticalAlignment="Center"> |
<Label Content="College: " Foreground="#ff8FB3FF" FontSize="12"/> |
<Label Content="{Binding Data.College}" FontSize="12" Foreground="#ff8FB3FF"/> |
</StackPanel> |
</Grid> |
</ControlTemplate> |
</Setter.Value> |
</Setter> |
</Style> |
0
Hi Maria Im,
Greetings,
Milan
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.
Thank you for your suggestion.
Greetings,
Milan
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.