hey guys, here are my requirements:
I need a simple class with only one Public property and no Public methods (the final Class will be more complex, but for testing this is all I need)
The Property is "Item" and takes a "String" as a parameter. It returns a "String" based on the parameter.
I then want be able to add instances of this object to a List or Array, and then Bind it to a Repeater or a ListView...
...most importantly, I want to be able to then refer to values in my simple Class via the Eval function:
<%# Eval("SomeIDString**") %>**.
Here are my problems:
I can't Bind at all unless I declare the Item property as the Default property...why?
When I use "Eval", I get an error in the lines of "[some property] does not exists". indeed it doesn't, because everything is accessed via the Item property. it then does works if I replace "Eval" with "Container.DataItem".
So, is there a way to use Eval instead of Container.DataItem? I would rather not have my class inherit any other classes because I want to keep it clean from supurfulous properties and/or methods.
Are there interfaces I need to implement?
Also, the reason I want to use Eval, is that as much as possible, I want to make the use of this Class simple, so the coder doesn't need to worry about special cases. I just want it to work, much like the DataTable Class, but with a much simpler, lighter-weight implementation.
cheers