开发者

asp.net how to bind List<model> data to gridview?

In my linq method it returns List as query result. The model is generated based on the fields of data table. E.G it has three fields model.id, mo开发者_如何学编程del.name, model.createTime. If I want to use gridview to display returned data which is in List format. How to do it?


GridView.DataSource = List<Model>
GridView.Databind()

You can set the Datasource property to your data and call Databind to update the grid from your data source.

This would be added to your code behind when the population should occur.

See MSDN.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜