GridView or Repeater?

What is the difference between GridView and Repeater? This is one of the most common questions that beginners ask when they are trying to get familiar with data bound controls. Both of these controls have their own using context and I try to explain when one should use GridView and when it is okay to use Repeater.

As first thing I want to say that GridView is more complex and powerful control that offers much more functionality than Repeater. Repeater has better performance because it is not so complex and doesn’t offer so rich functionality.

Repeater

Repeater is okay if you need to show data from some data source. It offers the basic rendering options: header, item, alternating item, separator and footer. It is really up to developer how to fill these templates. By example, it is easy to use Repeater to show read-only lists using templated elements.

Repeater is faster because it offers only basic data bound control rendering functionalities. If you want to show data and you don’t need any complex features described below then repeater is the right joice.

GridView

GridView is rendered as table with columns and it is created to show data and let users to manipulate it. GridView offers powerful built-in features like:

  • events for sorting data when user clicks on column heading,
  • row selection,
  • row operations like adding, editing and deleting,
  • paging,
  • command columns and events to handle the commands.

GridView is excellent choice if there is a need to show tabular data and also provide users with features described above.

Gunnar Peipman

Gunnar Peipman is ASP.NET, Azure and SharePoint fan, Estonian Microsoft user group leader, blogger, conference speaker, teacher, and tech maniac. Since 2008 he is Microsoft MVP specialized on ASP.NET.

    3 thoughts on “GridView or Repeater?

    • August 7, 2008 at 4:10 pm
      Permalink

      I think it’s better If you use ListView control in ASP.NET 3.5

      Best,

      quachnguyen

    • January 11, 2011 at 5:47 am
      Permalink

      is that right Performance wise Repeater is more far better than Gridview But Features wise Gridview is better

    • July 30, 2013 at 1:30 pm
      Permalink

      is there any thing that ..

      gridview or repeater, any one of them is better for seo…

    Leave a Reply

    Your email address will not be published. Required fields are marked *