简体   繁体   中英

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

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

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM