Hi All,
If any one tries to google "custom databinding", he/she will get several results on how to implement your custom data binding using attributes.
I have no problems with attributes, but I thought that this task should be simpler, and this is why I posting this question here.
I basically want to implement my own custom Drop Down List. I want this DDL to have a DataSource property and a DataBind() method.
The dataSource should accept any kind of collections, list, ... etc, just like the normal DataSource in .NET built-in server controls.
Inside the DataBind() method I want to loop through all items in the DataSource. For every item I will use the DataBinder class to retrieve the properties that I want to add to my custom DDL. I will specifically use DataBinder.Eval(object, string) method (Please tell me if there's a better way).
My primary problem is: I don't know how to convert the DataSource value into something that I can iterate over. The DataSource data type is (object). Please, is there a direct way to get the items of this DataSource?
Thanks in advance
WADIRUM Software is a Jordan-based specialized software provider for tourism-related industries.