In asp.net , what is the difference between gridview and repeater controls

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 00:53:41

问题


I have worked with both the controls for simple application development . Both almost do the same functionality. What is the difference between them ?


回答1:


There is a table here that compares the data bound server controls:

http://weblogs.asp.net/anasghanem/archive/2008/09/06/comparing-listview-with-gridview-datalist-and-repeater.aspx




回答2:


GridView always renders as a grid. Repeater allows you to create your own template layout. For instance, you can put things in divs. GridView also has a much more rich object model, while repeater is rather simplistic.

Yes, you can achieve similar results with both, but they are nowhere near the same thing.




回答3:


Both these controls are Data-Bound Web Server control.

GridView : It displays data as a table and has ability to preform sort, paging,edit and delete a record.

Repeater : has fewer templates then GridView. It renders a read-only list from the datasource.



来源:https://stackoverflow.com/questions/7328134/in-asp-net-what-is-the-difference-between-gridview-and-repeater-controls

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!