or
Imports
System.ComponentModel
Public
Class
Form1
Private
myList
As
BindingList(Of MyObject)
Private
Sub
Form1_Load(
ByVal
sender
As
Object
,
ByVal
e
As
EventArgs)
Handles
Me
.Load
myList =
New
BindingList(Of MyObject)()
myList.Add(
New
MyObject(1,
"Outdoor"
))
myList.Add(
New
MyObject(2,
"Hardware"
))
myList.Add(
New
MyObject(3,
"Tools"
))
myList.Add(
New
MyObject(4,
"Books"
))
myList.Add(
New
MyObject(5,
"Appliances"
))
AddHandler
myList.ListChanged,
AddressOf
myList_ListChanged
RadGridView1.DataSource = myList
End
Sub
Sub
myList_ListChanged(
ByVal
sender
As
Object
,
ByVal
e
As
ListChangedEventArgs)
End
Sub
Private
Sub
RadButton1_Click_1(
ByVal
sender
As
System.
Object
,
ByVal
e
As
System.EventArgs)
Handles
RadButton1.Click
myList.Add(
New
MyObject(6,
"Plants"
))
' DO NOT CHANGE SELECTION!
End
Sub
Public
Class
MyObject
Public
Sub
New
(
ByVal
myInt
As
Integer
,
ByVal
myString
As
String
)
_myInt = myInt
_myString = myString
End
Sub
Private
_myInt
As
Integer
Public
Property
MyInt()
As
Integer
Get
Return
_myInt
End
Get
Set
(
ByVal
value
As
Integer
)
_myInt = value
End
Set
End
Property
Private
_myString
As
String
Public
Property
MyString()
As
String
Get
Return
_myString
End
Get
Set
(
ByVal
value
As
String
)
_myString = value
End
Set
End
Property
End
Class
End
Class
Hello All,
I have added a handler to try and capture the double click of an editing cell on a grid - it never reaches the stop statement, the keydown item fires fine. Can anyone give me some pointers?
Private Sub radGridView1_CellEditorInitialized(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.GridViewCellEventArgs) Handles RadGridView1.CellEditorInitialized
Dim tbEditor As RadTextBoxEditor = TryCast(Me.RadGridView1.ActiveEditor, RadTextBoxEditor)
If Not tbEditor Is Nothing Then
If (Not tbSubscribed) Then
tbSubscribed = True
Dim tbElement As RadTextBoxEditorElement = CType(tbEditor.EditorElement, RadTextBoxEditorElement)
tbElement.TextBoxItem.Tag = Me.RadGridView1.Name
AddHandler tbElement.TextBoxItem.KeyDown, AddressOf tbElement_KeyDown
AddHandler tbElement.DoubleClick, AddressOf tbElement_DoubleClick
End If
End If
End Sub
Private Sub tbElement_DoubleClick(ByVal sender As Object, ByVal e As EventArgs)
Stop
End Sub
Private Sub tbElement_KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs)
If e.KeyCode = Keys.F1 Then
Stop
End If
End Sub