Hi, anyone can help me with the issue below?
I have a customized theme applied in my application. However, a customized editor doesn't apply the theme. I am not able to override the theme here.
Private Sub RadGridView3_EditorRequired(sender As Object, e As EditorRequiredEventArgs) Handles RadGridView3.EditorRequired
If RadGridView3.CurrentColumn.HeaderText = "Section" Then
e.Editor = New MyAutoCompleteEditor
End If
End Sub
Class MyAutoCompleteEditor
Inherits RadTextBoxControlEditor
Protected Overrides Function CreateEditorElement() As Telerik.WinControls.RadElement
Dim element As New RadAutoCompleteBoxElement With {
.AutoCompleteMode = AutoCompleteMode.Suggest
}
Return element
End Function
Public Overrides Sub OnKeyDown(ByVal e As System.Windows.Forms.KeyEventArgs)
Dim element As RadAutoCompleteBoxElement = TryCast(Me.EditorElement, RadAutoCompleteBoxElement)
If element.TextLength >= 40 Then
e.SuppressKeyPress = True
End If
RemoveHandler element.KeyPress, AddressOf RadAutoCompleteBox_KeyPress
AddHandler element.KeyPress, AddressOf RadAutoCompleteBox_KeyPress
RemoveHandler element.TextChanging, AddressOf RadAutoCompleteBox_TextChanging
AddHandler element.TextChanging, AddressOf RadAutoCompleteBox_TextChanging
If element.IsAutoCompleteDropDownOpen Then
Return
End If
MyBase.OnKeyDown(e)
End Sub
Private Sub RadAutoCompleteBox_KeyPress(ByVal sender As Object, ByVal e As KeyPressEventArgs)
Dim element As RadAutoCompleteBoxElement = TryCast(sender, RadAutoCompleteBoxElement)
If element.Items.Count > 0 Then
e.Handled = True
End If
End Sub
Private Sub RadAutoCompleteBox_TextChanging(ByVal sender As Object, ByVal e As Telerik.WinControls.TextChangingEventArgs)
If e.NewValue = "" Then
Return
End If
Dim el As RadAutoCompleteBoxElement = TryCast(sender, RadAutoCompleteBoxElement)
If el.Items.Count > 0 Then
e.Cancel = True
End If
End Sub
End Class
Text column
In the custom column, control is running on the Visual Studio 2022 theme.