开发者

DataSource Control for List<T>

I know all the data source controls like LinqDataSource, ObjectDataSource etc.

They are cool but they are inten开发者_如何学Goded to be used in conjunction with a database.

I actually need a simple data source control that can work with a plain old List (That supports delete, update, select, insert of course).

I was thinking of using the objectdatasource but the select, update... methods are not present in the List<T>.

So is there such a control or do I have to roll my own? Should I inherit from the objectdatasource?


The easiest thing to do would be to create a class that contains an instance of your list as well as methods for Selecting, Updating, Inserting, and Deleting from the list it contains. Then you can use the ObjectDataSource for databinding.


I made the control I was talking about. I created a custom control inheriting from ObjectDataSource and then added a property which sets a Static/Shared list as a internal datasource. It works quite nice. If someone's interested contact me.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜