M
Martin
what are the conditions in order to bind to an object? i have an object,
which implements the IList interface. Now I'am able to bind the objects,
which are hold by the collection.
now i implemented two properties in my collection. but i'm not able to bind
to the properties of the collection itself. it must be the object in the
list. that are my experiences.
Example:
public class MyCollection : IList {
//Implementations of IList and so on..
public event EventHandler myValueChanged;
public int myValue
{
get { return iMyValue; }
set
{
iMyValue = value;
if(myValueChanged != null)
myValueChanged(this, EventArgs.Empty);
}
}
}
And i try to bind to an object..
//That works...
textBox1.DataBindings.Add("Text", myClassInstance[1],
"ValueOfMyObjectInList");
//That doesn't work
numericBox1.DataBindings.Add("Value", myClassInstance, "myValue");
I get an error which tells me, that he isn't able to bind to a property or
column of the datasource.
parameter name: dataMember
is it possible to bind to a property of a collection itself?
which implements the IList interface. Now I'am able to bind the objects,
which are hold by the collection.
now i implemented two properties in my collection. but i'm not able to bind
to the properties of the collection itself. it must be the object in the
list. that are my experiences.
Example:
public class MyCollection : IList {
//Implementations of IList and so on..
public event EventHandler myValueChanged;
public int myValue
{
get { return iMyValue; }
set
{
iMyValue = value;
if(myValueChanged != null)
myValueChanged(this, EventArgs.Empty);
}
}
}
And i try to bind to an object..
//That works...
textBox1.DataBindings.Add("Text", myClassInstance[1],
"ValueOfMyObjectInList");
//That doesn't work
numericBox1.DataBindings.Add("Value", myClassInstance, "myValue");
I get an error which tells me, that he isn't able to bind to a property or
column of the datasource.
parameter name: dataMember
is it possible to bind to a property of a collection itself?