Solved

Diff b/w Data\Grid, DataList & Repeater - Their Uses ?

Posted on 2011-03-09
6
354 Views
Last Modified: 2012-05-11
Hello Experts !

My Query: When to use DataGrid, DataList, Repeater in project ? I mean to say whats their individual differences and at what scenarios respective ones will be efficient ?

Any added information about them will be helpfull !

Thanx in advance !
0
Comment
Question by:mdkshah
6 Comments
 
LVL 2

Expert Comment

by:HSIHSA
ID: 35091996
Please go through this link, may be it will help in giving differences form the implementation point of view.

http://www.geekinterview.com/question_details/4560
0
 
LVL 10

Assisted Solution

by:Asim Nazir
Asim Nazir earned 250 total points
ID: 35092011
The DataGrid Web control provides the greatest feature set of the three data Web controls, with its ability to allow the end-user to sort, page, and edit its data. The DataGrid is also the simplest data Web control to get started with, as using it requires nothing more than adding a DataGrid 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 DataGrid is the least efficient of the three data Web controls, especially when placed within a Web form.

With its templates, the DataList provides more control over the look and feel of the displayed data than the DataGrid. 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.

Finally, the 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 DataGrid and DataList. 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 DataGrid's.

0
 
LVL 9

Accepted Solution

by:
jkofte earned 250 total points
ID: 35092050
Data Grid: Forms a table and displays the data in it. Useful when you have to display information like an excel sheet on HTML. Also has paging.
The most complex of three.
Example: http://www.w3schools.com/browsers/browsers_stats.asp

Data List: When you have to repeat the data but display them on let's say three columns like the link below, use data list.
Not very complex but not as simple as repeater. Can use multiple columns.
Example: http://www.bestbuy.com/site/Electronics/TV-Video/abcat0100000.c?id=abcat0100000

Repeater: Simply repeats the data. When you need to display a single column repeating data, use repeater. It adds no HTML div or table or nothing, just repeats the HTML you put in your item template. Simplest of all three but the most customizable.
Example: Blogs, header, a picture if any and summary is displayed in the home pages of the blogs and it is repeated.
http://www.smashingmagazine.com/
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 8

Expert Comment

by:Anurag Agarwal
ID: 35092638
0
 

Author Comment

by:mdkshah
ID: 35103355
Thanx Experts 4 Ur Quick Response with Solutions. I'm Providing Multiple Solutions to this question, for both asimnazir123 & jkofte for providing the solution in thier own words which is easily understandable 2 all, instead of providing links.

Once again Thanx to all Experts 4 their Valuable time !

TakeCare..
0
 
LVL 8

Expert Comment

by:Anurag Agarwal
ID: 35110492
Although it doesn't matter but mdkshah if u had really gone thru that link it would have definately helped u by not only providing u with basic idea for what u were looking but also with some deep knowledge by which ur own concepts would have become more strong , I believe u must be running out of time due to ur daily business thts why u skipped it......... any ways thanks for the advice !!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now