Never-mind!
The problem was with my code. I made some mistakes with the inherits and implements.
Just for a documentation, if anyone wants to convert this piece of code to VB.NET, pay attention to this:
VB.NET, as far as I know, doesn't support multiple inherits. So, the IGridView interface was as an implement.
Doing this, I had to explicit re-implement the methods for IGridView interface, with the same code as GridVisualElement inherited class. C# apparently accepts the same implement for both. VB.NET didn't accept it automatically for me. Damn VB! x)
So, here is the class re-written in VB.NET if someone needs to use:
Imports
Telerik.WinControls.UI
Imports
Telerik.WinControls
Public
Class
ColumnChooserGridViewElement
Inherits
GridVisualElement
Implements
IGridView
#Region "Fields"
Private
_titleBar
As
RadTitleBarElement
Private
_columnChooser
As
ColumnChooserElement
Private
_stackLayout
As
StackLayoutElement
#End Region
#Region "Initialization"
Protected
Overrides
Sub
InitializeFields()
MyBase
.InitializeFields()
StretchVertically =
True
MinSize =
New
Size(200, 0)
End
Sub
Protected
Overrides
Sub
CreateChildElements()
MyBase
.CreateChildElements()
_stackLayout =
New
StackLayoutElement()
_stackLayout.Orientation = Orientation.Vertical
_stackLayout.StretchVertically =
True
_stackLayout.StretchHorizontally =
True
Children.Add(_stackLayout)
_titleBar =
New
RadTitleBarElement()
_titleBar.Text =
"Column Chooser"
_titleBar.StretchVertically =
False
_titleBar.AllowResize =
False
_titleBar.CloseButton.Visibility = ElementVisibility.Collapsed
_titleBar.MinimizeButton.Visibility = ElementVisibility.Collapsed
AddHandler
_titleBar.MaximizeRestore,
AddressOf
TitleBarMaximizeRestore
_stackLayout.Children.Add(_titleBar)
_columnChooser =
New
ColumnChooserElement()
_columnChooser.StretchVertically =
True
_stackLayout.Children.Add(_columnChooser)
End
Sub
#End Region
#Region "Event Handlers"
Private
Sub
TitleBarMaximizeRestore(sender
As
Object
, args
As
EventArgs)
Visibility = ElementVisibility.Collapsed
GridViewElement.GridControl.ShowColumnChooser(_columnChooser.ViewTemplate)
RemoveHandler
GridViewElement.ColumnChooser.FormClosed,
AddressOf
ColumnChooserFormClosed
AddHandler
GridViewElement.ColumnChooser.FormClosed,
AddressOf
ColumnChooserFormClosed
End
Sub
Private
Sub
ColumnChooserFormClosed(sender
As
Object
, e
As
FormClosedEventArgs)
Visibility = ElementVisibility.Visible
End
Sub
#End Region
#Region "IGridView Members"
Public
Sub
Initialize(gridElement
As
RadGridViewElement, viewInfo
As
GridViewInfo)
_columnChooser.Initialize(gridElement, viewInfo)
End
Sub
Public
Sub
IGridView_Detach()
Implements
IGridView.Detach
_columnChooser.Detach()
End
Sub
Public
Sub
IGridView_Initialize(
ByVal
gridViewElement
As
RadGridViewElement,
ByVal
viewInfo
As
GridViewInfo)
Implements
IGridView.Initialize
_columnChooser.Initialize(gridViewElement, viewInfo)
End
Sub
Public
Sub
Detach()
_columnChooser.Detach()
End
Sub
Public
Sub
IGridView_UpdateView()
Implements
IGridView.UpdateView
_columnChooser.UpdateView()
End
Sub
Public
Sub
UpdateView()
_columnChooser.UpdateView()
End
Sub
Public
ReadOnly
Property
IGridView_GridViewElement()
As
RadGridViewElement
Implements
IGridView.GridViewElement
Get
Return
_columnChooser.GridViewElement
End
Get
End
Property
Public
ReadOnly
Property
GridViewElement()
As
RadGridViewElement
Get
Return
_columnChooser.GridViewElement
End
Get
End
Property
Public
ReadOnly
Property
IGridView_ViewInfo()
As
GridViewInfo
Implements
IGridView.ViewInfo
Get
Return
_columnChooser.ViewInfo
End
Get
End
Property
Public
ReadOnly
Property
ViewInfo()
As
GridViewInfo
Get
Return
_columnChooser.ViewInfo
End
Get
End
Property
#End Region
End
Class
Regards!