I found the solution :
private System.Windows.Forms.ListBox dropdownsource = new ListBox() ;
[RefreshProperties(RefreshProperties.Repaint)]
[TypeConverter("System.Windows.Forms.Design.DataSou rceConverter")]
public object DataSource{
get {
return this.dropdownsource.DataSource;
}
set{
if (this.dropdownsource.DataSource != value)
this.dropdownsource.DataSource = value;
}
}
[TypeConverter("System.Windows.Forms.Design.DataMem berFieldConverter")]
[Editor("System.Windows.Forms.Design.DataMemberFiel dEditor",typeof(System.Drawing.Design.UITypeEditor ))]
[DefaultValue("")]
public string DisplayMember{
get {
return this.dropdownsource.DisplayMember;
}
set{
if (this.dropdownsource.DisplayMember != value)
this.dropdownsource.DisplayMember = value;
}
}
[CLSCompliant(false)]
[TypeConverter("System.Windows.Forms.Design.ValueMe mberFieldConverter")]
[Editor("System.Windows.Forms.Design.DataMemberFiel dEditor",typeof(System.Drawing.Design.UITypeEditor ))]
[DefaultValue("")]
public string ValueMember{
get {
return this.dropdownsource.ValueMember;
}
set{
if (this.dropdownsource.ValueMember != value)
this.dropdownsource.ValueMember = value;
}
}
__________________________________________________ _________________________
Alvaro E. Gonzalez V. wrote:
Hi,
I use this code:
private System.Windows.Forms.ListBox dropdownsource = new ListBox() ;
public object DataSource{
get {
return this.dropdownsource.DataSource;
}
set{
if (this.dropdownsource.DataSource != value)
this.dropdownsource.DataSource = value;
}
}
I hope that in the properties palete be shown the same way that
DataSource ListBox's property
I must any attribute o Wath somethings i must do?
__________________________________________________ _______________________
Pete Davis wrote:
You can use a DataSource and DataMember. Underneath, this creates a
BindingManagerBase as so:
BindingManagerBase myBMB = BindingContext[dataSource, dataMember].
You can then access the data via the BindingManagerBase.
In most cases, you'll find the BindingManagerBase is actually a
CurrencyManager or RelatedCurrencyManager, depending on what exactly
you're binding to.
For more information about CurrencyManager I recommend this page:
http://noiseehc.freeweb.hu/CurrencyManager.html
I've also posted two article on my web site about it. I plan to do
more, just haven't gotten around to it yet:
http://www.petedavis.net/MySite/DynP...aspx?pageid=19
http://www.petedavis.net/MySite/DynP...aspx?pageid=22
Pete
The BindingContext actually returns a BindingManagerBase object but
for a datasource and
"Alvaro E. Gonzalez V." <ag********@gmail.com> wrote in message
news:O0**************@TK2MSFTNGP14.phx.gbl...
Hello!!!
I'm building a control that in a property
assign a Dataset which they are initialized and another property Like
DataMember.
Similar as it happens to the DataSource property of a
System.Windows.Forms.ListBox...
That mechanism can be used or as is the best way to do it...
Thanks.
Alvaro.