Adrian Guillen
Top achievements
Rank 1
Adrian Guillen
asked on 30 Nov 2009, 10:13 PM
If a click an image on the radcarousel how do I do to open a window or a dialog when I double click the selected image item of the carousel?
3 Answers, 1 is accepted
0
Hello Adrian Guillen,
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.
The MouseDown events args provide a property CLickCount which can be used to detect multiple clicks.
<
telerik:RadCarouselPanel
>
<
Image
Width
=
"50"
Height
=
"50"
Source
=
"1.jpg"
MouseDown
=
"Image_MouseDown"
/>
<
Image
Width
=
"50"
Height
=
"50"
Source
=
"2.jpg"
MouseDown
=
"Image_MouseDown"
/>
<
Image
Width
=
"50"
Height
=
"50"
Source
=
"3.jpg"
MouseDown
=
"Image_MouseDown"
/>
<
Image
Width
=
"50"
Height
=
"50"
Source
=
"4.jpg"
MouseDown
=
"Image_MouseDown"
/>
</
telerik:RadCarouselPanel
>
private
void
Image_MouseDown(
object
sender, MouseButtonEventArgs e)
{
if
(e.ClickCount == 2)
{
// open window
}
}
Hope this helps.
Kind regards,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.
0
Adrian Guillen
Top achievements
Rank 1
answered on 01 Dec 2009, 10:47 PM
Thank you for your help and quickness in your response, but i´m using the carousel, not the carousel panel. And have a list of images as the itemsource for the carousel. If you know how to do it in my case i'll appreciate your help. Thank you
0
Hello Adrian Guillen,
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.
Here is how it can be done when using RadCArousel instead of RadCarouselPanel:
public
Window1()
{
InitializeComponent();
RadCarousel1.ItemsSource =
new
[]
{
new
BitmapImage(
new
Uri(
"online.png"
, UriKind.Relative)),
new
BitmapImage(
new
Uri(
"online.png"
, UriKind.Relative)),
new
BitmapImage(
new
Uri(
"online.png"
, UriKind.Relative)),
new
BitmapImage(
new
Uri(
"online.png"
, UriKind.Relative))
};
this
.RadCarousel1.AddHandler(FrameworkElement.MouseDownEvent,
new
MouseButtonEventHandler(OnMouseDown),
true
);
}
private
void
OnMouseDown(
object
sender, MouseButtonEventArgs e)
{
var sourceElement = e.OriginalSource
as
FrameworkElement;
var carouselItem = sourceElement.ParentOfType<CarouselItem>();
if
(carouselItem !=
null
&& e.ClickCount >= 2)
{
// open window
}
}
Hope this helps.
Regards,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.