below is my code is add item to carousel
RadCarousel1.Items.Add(ButtonBox1)
RadCarousel1.Items.Add(ButtonBox2)
RadCarousel1.Items.Add(ButtonBox3)
RadCarousel1.Items.Add(ButtonBox4)
Then, my question is
1,How to catch which above button is click in below subroutin ,
Private Sub RadCarousel1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadCarousel1.SelectedIndexChanged
End Sub
2, mouse over item can change mouse icon to hand that item move to path of specific position whcih predefine.
Hope you can me.
Thanks
8 Answers, 1 is accepted
You can get the selected button using the Carousel's SelectedItem in RadCarousel1_SelectedIndexChanged:
me.radCarousel1.SelectedItem
About the second question you can change the mouse cursor using each Carousel item button's events MouseHover and MouseLeave. Refer to the code below:
AddHandler
buttonBox1.MouseHover,
AddressOf
imageItem_MouseHover
AddHandler
buttonBox1.MouseLeave,
AddressOf
imageItem_MouseLeave
Private
Sub
imageItem_MouseLeave(
ByVal
sender
As
Object
,
ByVal
e
As
EventArgs)
Cursor = Cursors.
Default
End
Sub
Private
Sub
imageItem_MouseHover(
ByVal
sender
As
Object
,
ByVal
e
As
EventArgs)
Cursor = Cursors.Hand
End
Sub
but you cannot move an item to the specific positions with Drag&Drop, because coordinates for items are evaluated only from RadCarouselCalculator. Please, excuse us for the inconvenience.
Sincerely yours,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Hi,Peter
Thank your resolution and help.
for question 1
Private Sub RadCarousel1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadCarousel1.SelectedIndexChanged
when mouse click at button1
MsgBox(Me.RadCarousel1.SelectedItem) <=== may be show <button1.text> ,but show <Telerik.WinControls.UI.RadButtonElement
click at button2
have same result
MsgBox(Me.RadCarousel1.SelectedItem) <=== may be show <button2.text> ,but show <Telerik.WinControls.UI.RadButtonElement
End Sub
Hope can help me
Thanks
Thanks for the provided information.
You should cast the SelectedItem to RadButtonElement and show the Text property of the RadButtonElement:
Hope this helps.Dim
selectedButton as RadButtonElement
selectedButton =
CType
(radCarousel.SelectedItem, RadButtonElement)
MessageBox.Show( selectedButton.Text )
Regards,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
thanks your help.
Below is exact code worked for this question and shared to other.
Private Sub RadCarousel1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadCarousel1.SelectedIndexChanged
Dim selectedButton As RadButtonElement
selectedButton = CType(Me.RadCarousel1.SelectedItem, RadButtonElement)
MessageBox.Show(selectedButton.Text)
End Sub
1,another question is code add to Sub RadCarousel1_SelectedItemChanged cann't work That Hope you can tell me what?
2,When Clicked button_next also fire RadCarousel1_SelectedIndexChanged,you can see hardcopy screen at attach file?
3,I hope program run like Telerik run demo Integration section function?
Thanks Peter
The reason that SelectedItemChanged is not working as SelectedIndexChanged is virtualization - this event also fires with non virtualized items, so you can handle SelectedIndexChanged instead of SelectedItemChanged
I cannot find any attached files in your ticket? Can you clarify what do you mean with "run like Telerik run demo Integration section function?" - we do not have any carousel examples in integration section in our example application.
Regards,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
I hope get hardcopy of attached file of sample code in Vb.net,
Those samples are satisifiable demand for me.
Thanks
This carousel is a custom implementation for our demos only - this implementation is not supported. Please, use RadCarousel instead.
All the best,
Vassil
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Thanks
YC