RSS

Difference Between GridView,DataList and Repeater Control

11 Mar

The GridView Web control provides the greatest feature set of the Rpeater control , with its ability to allow the end-user to sort, page, and edit its data. The GridView is also the simplest data Web control to get started with, as using it requires nothing more than adding a GridView to the Web page and writing a few lines of code. The ease of use and impressive features comes at a cost, though, namely that of performance: the GridView is the least efficient of the Repeater control, especially when placed within a Web form.

The DataList provides more control over the look and feel of the displayed data than the DataGrid with its templates. Using templates, however, typically requires more development time than using the DataGrid’s column types. The DataList also supports inline editing of data, but requires a bit more work to implement than the DataGrid. Unfortunately, providing paging and sorting support in the DataList is not a trivial exercise. Making up for these lacking built-in features, the DataList offers better performance over the DataGrid.

Repeater control allows for complete and total control of the rendered HTML markup. With the Repeater, the only HTML emitted are the values of the databinding statements in the templates along with the HTML markup specified in the templates—no “extra” HTML is emitted, as with the GridView. By requiring the developer to specify the complete generated HTML markup, the Repeater often requires the longest development time. Furthermore, the Repeater does not offer built-in editing, sorting, or paging support. However, the Repeater does boast the best performance of the three data Web controls. Its performance is comparable to the DataList’s, but noticeably better than the GridView’s.

Advertisements
 
Leave a comment

Posted by on March 11, 2011 in Uncategorized

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: