Gunnar Peipman's ASP.NET blog

ASP.NET, C#, SharePoint, SQL Server and general software development topics.

Sponsors

News

Blog Directory
Blogging Fusion Blog Directory
Web Directory
Blog Directory
EatonWeb Blog Directory
GeekySpeaky: Submit Your Site!
Blog Directory
blogarama - the blog directory
Bloglisting.net - The internets fastest growing blog directory
Blogio.net blog directory
Free Blog Directory
blog search directory
Software Blogs
RSSMicro FeedRank Results
On our way to 1,000,000 rss feeds - millionrss.com
Listed in LS Blogs the Blog Directory and Blog Search Engine
blog directory
Link With Us - Web Directory
Web Blogs Directory Add Your Blog.com

Certificates

Links

Social

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.

Comments

Dew Drop - July 25, 2008 | Alvin Ashcraft's Morning Dew said:

Pingback from  Dew Drop - July 25, 2008 | Alvin Ashcraft's Morning Dew

# July 25, 2008 7:59 AM

quachnguyen said:

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

Best,

quachnguyen

# August 7, 2008 10:10 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)