Good day,
I am creating a custom control based on the standard windows control TreeView. I'm implementing data binding开发者_JAVA百科 - which is working nicely - but I'm looking for a way to select the data source from a list in the property explorer - much like the ComboBox's DataSource property. My data source property currently looks something like this:
[
Description("Gets or sets a value representing the bound data source."),
DefaultValue(null),
Browsable(true)
]
public object DataSource
{
get{ return _oDataSource; }
set{ /* binding */ }
}
I assume there is some attribute I have to set; or perhaps the data source needs to be of a specific type.
Thanx in advance for any comments and suggestions.
Kind regards, me
Try adding an AttributeProvider attribute pointing to IListSource, as in the stock ComboBox's definition of it's DataSource property:
[RefreshProperties(RefreshProperties.Repaint)]
[AttributeProvider(typeof (IListSource))]
[DefaultValue(null)]
public new object DataSource { get; set; }
精彩评论