C
Christoph Boget
Consider the following:
class MyClass {
public string Var1;
public string Var 2;
}
class MyClassList : System.Collections.CollectionBase {
// requisite access methods
}
Now, if I have a drop down box, can I define the the
datasource to be an instatiation of 'MyClassList' filled
with 'MyClass' objects? And set the 'DataTextField'
and 'DataValueField' properties to the 'Var1' and 'Var2'
properties of the 'MyClass' objects? If so, how?
Because I tried it and it didn't work. I think it's because
it doesn't know how to implicitely access the 'Var1' and
'Var2' properties, but that's just my guess.
thnx,
Christoph
class MyClass {
public string Var1;
public string Var 2;
}
class MyClassList : System.Collections.CollectionBase {
// requisite access methods
}
Now, if I have a drop down box, can I define the the
datasource to be an instatiation of 'MyClassList' filled
with 'MyClass' objects? And set the 'DataTextField'
and 'DataValueField' properties to the 'Var1' and 'Var2'
properties of the 'MyClass' objects? If so, how?
Because I tried it and it didn't work. I think it's because
it doesn't know how to implicitely access the 'Var1' and
'Var2' properties, but that's just my guess.
thnx,
Christoph