Denis Cilliers
Top achievements
Rank 1
Denis Cilliers
asked on 19 Nov 2012, 01:21 PM
The documentation does not show how to capture the events from the custom Item buttons.
http://www.telerik.com/help/winforms/listview-custom-items.html
Please can we have an example in vb.net
thanks
http://www.telerik.com/help/winforms/listview-custom-items.html
Please can we have an example in vb.net
thanks
4 Answers, 1 is accepted
0
Jason
Top achievements
Rank 1
answered on 20 Nov 2012, 09:24 PM
Just provide an override for the click event in the MyCustomVisualItem class.
Public Overrides Sub buttonElement1_Click(sender As Object, e As EventArgs)
'' do something
End Sub
0
Denis Cilliers
Top achievements
Rank 1
answered on 21 Nov 2012, 09:25 AM
Nope the event does not fire
This is how I currently have the code
But no success so far
This is how I currently have the code
Private
WithEvents
buttonElement1
As
RadButtonElement
Private
WithEvents
checkboxComplete
As
RadCheckBoxElement
Public
Sub
ButtonElement1_Click(sender
As
Object
, e
As
EventArgs)
Handles
buttonElement1.Click
MessageBox.Show(
"ButtonElement1_Click"
)
End
Sub
Public
Sub
CheckboxComplete1_StateChanged(sender
As
Object
, e
As
EventArgs)
Handles
checkboxComplete.ToggleStateChanged
MessageBox.Show(
"CheckboxComplete1_StateChanged"
)
End
Sub
But no success so far
0
Jason
Top achievements
Rank 1
answered on 21 Nov 2012, 05:44 PM
If you can translate some C# to VB.NET just download the code in this post - it shows how to do it.
http://www.telerik.com/community/forums/winforms/listview/custom-button-in-4th-column.aspx#2306251
http://www.telerik.com/community/forums/winforms/listview/custom-button-in-4th-column.aspx#2306251
0
Hello guys,
Thank you for writing.
In the CreateChildElements method of the custom item you can subscribe to the button's Click event:
and then handle the click as you need:
Stefan
the Telerik team
Thank you for writing.
In the CreateChildElements method of the custom item you can subscribe to the button's Click event:
AddHandler
buttonElement1.Click,
AddressOf
buttonElement1_Click;
Private
Sub
buttonElement1_Click(sender
As
Object
, e
As
EventArgs)
'do smth
End
Sub
I hope this helps. Let us know if you have any additional questions.
Regards,Stefan
the Telerik team