M
Michael Maes
Hi,
I have a UserControl containing some controls of which one is a ComboBox.
All the InternalControls are Private and some are allowed to be accessed through Public Methods.
One of the things I would like to do (of course) is set the DataBindings.
Something clearly is wrong with the approach I use, because I can't set the Properties in the Designer, the DataSource-Property appears like 'ReadOnly', there is no "dropdown" with the list from System.Windows.Forms.ListControl
Dim _DataSource As Object
<EditorBrowsable(EditorBrowsableState.Always), _
Browsable(True), _
Description("The data source for the dropdown list."), Category("Data")> _
Public Overridable Property DataSource() As Object
Get
Return _DataSource
End Get
Set(ByVal Value As Object)
_DataSource = Value
Me.Internal_UiComboBox.DataSource = Value
End Set
End Property
Dim _DisplayMember As String
<EditorBrowsable(EditorBrowsableState.Always), _
Browsable(True), _
Description("Specifies the property of the data source whose content you want to display."), Category("Data")> _
Public Overridable Property DisplayMember() As String
Get
Return _DisplayMember
End Get
Set(ByVal Value As String)
_DisplayMember = Value
Me.Internal_UiComboBox.DisplayMember = Value
End Set
End Property
In the Advanced Wizard I can Set a Value, only, I can't set a DataSet, only a DataSet.DataTable.DataColumn.
What is wrong with my approach?
TIA,
Michael
I have a UserControl containing some controls of which one is a ComboBox.
All the InternalControls are Private and some are allowed to be accessed through Public Methods.
One of the things I would like to do (of course) is set the DataBindings.
Something clearly is wrong with the approach I use, because I can't set the Properties in the Designer, the DataSource-Property appears like 'ReadOnly', there is no "dropdown" with the list from System.Windows.Forms.ListControl
Dim _DataSource As Object
<EditorBrowsable(EditorBrowsableState.Always), _
Browsable(True), _
Description("The data source for the dropdown list."), Category("Data")> _
Public Overridable Property DataSource() As Object
Get
Return _DataSource
End Get
Set(ByVal Value As Object)
_DataSource = Value
Me.Internal_UiComboBox.DataSource = Value
End Set
End Property
Dim _DisplayMember As String
<EditorBrowsable(EditorBrowsableState.Always), _
Browsable(True), _
Description("Specifies the property of the data source whose content you want to display."), Category("Data")> _
Public Overridable Property DisplayMember() As String
Get
Return _DisplayMember
End Get
Set(ByVal Value As String)
_DisplayMember = Value
Me.Internal_UiComboBox.DisplayMember = Value
End Set
End Property
In the Advanced Wizard I can Set a Value, only, I can't set a DataSet, only a DataSet.DataTable.DataColumn.
What is wrong with my approach?
TIA,
Michael