you can simply do this:
using System.ComponentModel;
public class YourClass:SomeControl
{
object DataSource_m;
[AttributeProvider(typeof(IListSource)), RefreshProperties(RefreshProperties.Repaint)]
public object DataSource
{
get{ return DataSource_m;}
set{ DataSource_m = value;}
}
}
[Update: you'll probably also want the RefreshProperties Attribute]
[Response to comment]
This is my class:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.ComponentModel;
namespace TestFormCSharp
{
class MyDataSourceClass:Control
{
object dataSource_m;
[AttributeProvider(typeof(IListSource)), RefreshProperties(RefreshProperties.Repaint)]
public object DataSource
{
get { return dataSource_m; }
set { dataSource_m = value; }
}
}
}
and this is what I get:
http://yfrog.com/bfscreenshotdatasourcej[
^]
If you're not getting the same, then you'd have to show us more of your class declaration and/or tell us what version of VS you're using...if you're using VS;