Last post Nov 05, 2013 05:24 AM by mahedee
Nov 04, 2013 04:37 PM|michael5119|LINK
can anyone briefy explain wht differenct between 6 of them~ thx :)
Nov 04, 2013 04:48 PM|kedarrkulkarni|LINK
can anyone briefy explain wht differenct between 6 of them~ thx :)
these are all data bound controls of asp.net... the main difference between them is the scenario in which u like to use them...
for example, the gridview is useful when u want to display list if items together and ability to edit/delete them in a tabular format...
same thing if u want to allow one record at a time then u can go with detailsview... get a overview of all controls here and decide which one fits the requirement at hand
or, check this to know about different features of each control...
hope this helps...
Nov 05, 2013 05:11 AM|Akii Malam|LINK
The GridView: it supports paging but it doesn't provide a flexible layout , since its mainly used to display the
data in a table based layout.And If we looked at data inserting , the Gridview doesn't have a built in support for inserting data( since it doesn't call the insert method of it underlying data source when you click on a button with a CommadName set to "Insert"
The Repeater control : you will find that it provides a flexible layout but it doesn't support data grouping ,inserting,deleting , updating and paging through the data .
The Repeater and GridView controls are used differently. A GridView control is used when you want to display a set of data in a table format. A Repeater is when you want to display data repeatedly, but not necessarily in a tabular format. If you want a table,
use a GridView, otherwise use a Repeater. The speed of loading/updating is negligible between the two. It sounds like the GridView is what you are probably looking for.
DataGrid - Old version of the Gridview. A gridview is a super datagrid.
The DataList Control
The DataList control works like the Repeater control. It repeats data for each row in your data set, and it displays this data according to your defined template. However, it lays out the data defined in the template within
various HTML structures. This includes options for horizontal or vertical layout, and it also allows you to set how the data should be repeated, as flow or table layout.
The DataList control does not automatically use a data source control to edit data. Instead, it provides command events in which you can write your own code for these scenarios. To enable these events, you add a Button control to one of
the templates and set the button’s CommandName property to the edit, delete, update, or cancel keyword. The appropriate event is then raised by the DataList control.
ListView - the new Datalist :). Almost a hybrid of the datalist and gridview where you can use paging and build in Gridview like functionality, but have the freedom of design. One of the new controls in this family.
The ListView control (unlike DataList and Repeater) also implicitly supports the ability to edit, insert, and delete data by using a data source control. You can define individual templates for each of these scenarios.
ListView (note the edit,group,insert ,layout)
DataList (note the Style pairs)
Nov 05, 2013 05:15 AM|nandankesh|LINK
plz check this link
Nov 05, 2013 05:24 AM|mahedee|LINK
If you look under Data tab on Visual Studio Toolbox, you can see several controls that could be used to display data from some data source, like database or XML file. Standard ASP.NET data presentation controls are:
- ListView and
Every of these controls could be used to display data. Logical question is, why ASP.NET offers so many controls for same task? What are differences between these controls and most important, when to use each of them?
We can divide data presentation controls into two main groups. First group consists of DetailsView and FormView control. These two controls can only show individual record at the same time. DetailsView and FormView are similar. Main difference is that DetailsView
control has pre-built rendering, while FormView control requires template. Because of this, DetailsView demands less work, but FormView is more customizable.
In second group are Repeater, DataList, GridView and ListView control. These controls show collection of records, and are commonly called data list controls.
Image 1: Data tab on Visual Studio Toolbox
Repeater control is derived from Control class. Repeater simply repeats data given in templates. Repeated data is usually HTML code mixed with records from data source. Repeater's output is not predefined. Because of that, Repeater demands most work to define
template. In return it gives us most flexibility to build layout and optimize presentation.
With same template and same data set, Repeater usually works faster of DataList or GridView controls. This is mostly because of DataReader class, which is used for read only access. DataReader is faster than DataSet or DataTable classes commonly used with
Compared to GridView and DataList control, Repeater has limited features. By default, Repeater is good for displaying of data. It is not best choice if you need editing of data. Also, by default it doesn't provide paging and sorting of records.
Unlike Repeater, DataList control is derived from WebControl class. That gives it a number of style properties like BorderStyle, BackColor, ForeColor etc.
DataList is somewhere between Repeater and GridView, in many ways looks like a compromise between these two. DataList has more features but more limited in design when compared to Repeater. In the other hand, it has more flexibility and less features than
Also, DataList has RepeatDirection, RepeatColumns and RepeatLayout properties, which are unique for DataList control. These properties are useful when you need to create presentation with more than one record per row, like image gallery, product catalog
etc. For example, let say you are creating an image gallery and want to show 5 images per row. Repeater would require checking of record position and manipulating HTML. With DataList, just use RepeatDirection="Horizontal" and RepeatColumns="5".
RepeatLayout could be Table or Flow, depending of do you need HTML table structure in layout.
Like DataList control, GridView is derived from WebControl class and includes numerous style properties. In addition to this, GridView is most complex control and have most properties. Numerous features include data paging, sorting, updating and deleting
of records. First versions of ASP.NET had DataGrid control. GridView is replaced DataGrid in ASP.NET 2.0 as improved version of old DataGrid control.
GridView displays data in form of grid. Rows and columns are represented as HTML table. This is very useful if you need grid-like presentation. If you need to present data in table layout, then GridView requires a minimum of effort. In same time, if you
want more customizable flow layout, GridView is not best option.
Common problem when using GridView control could be large ViewState which makes page loads slower and requires more bandwidth. This could be insignificantly on low traffic website, but keep in mind that for each second while the page loads, the percentage
of visitors will become impatient and leave website. Also, massive view state is not good for SEO (search engine optimization).
One more problem is using of default pager on large tables or high traffic websites. If default paging is used, GridView will load complete dataset in memory, which descreases website's performances.
ListView control is newest data presentation control, introduced in ASP.NET 3.5. Previous controls (Repeater, DataList and GridView) logically follow each other. For example, Repater is simplest but fastest, then DataList has more features but more overheads
too, and finally GridView is most complex, has most features, but heaviest and thus slowest on page.
Now, there is new ListView control which tries to provide best from both sides: speed and flexibility in design, and also a lot of features like paging, updating or deleting of records etc. Because of this, ListView control is often better choice than Repeater
Flexibility in design comes with price. To use ListView, you'll probably have to write a lot of markup code. For simple table layout, GridView requires much less work.
ListView has new LayoutTemplate. Instead of Header and Footer templates, ListView has just LayoutTemplate. Main advantage of LayoutTemplate when compared to Header and Footer templates is that LayoutTemplate makes markup code looks more object oriented.
So, it is not a big difference between these two models. It is possible to achieve same results with LayoutTemplate on ListView like with HeaderTemplate and FooterTemplate on Repeater, DataList and GridView.
Table comparison is the easiest way to quickly decide which data list control is best for your specific project requirements.
In this tutorial, I covered some differences between ASP.NET data list controls. Repeater, DataList, GridView and ListView have many common traits too. They share properties like DataSource, DataBound, and also events ItemCreated, ItemDataBound etc. Because
of similarities between controls, it is usually not hard to switch to another control if first choice is not good. For example, if you used DataList in previous code, you can change it into ListView to use its new InsertTemplate feature.
ListView control can exceed the capabilities of Repeater or DataList control, but GridView still has advantage in faster implementation and short markup code. GridView's common problem is large ViewState which could cause page loads slowly.
Default GridView paging opens complete data set in server's memory. For large tables or for high traffic websites, this will overload web server's resources. Even new ListView's DataPager control still opens all records in memory. Also, pages are opened
By recognizing this problem, Bean Software created
SEO Pager control which solves all paging issues with Repeater, DataList, GridView and ListView control:
- Supports templates, so your pager look any way you want.
- Application's code works with selected page only, not complete data set. On this way, whatever data list control you choose, it will work fast and web server's resources remains free.
- Supports both standard post back and plain hyperlinks in pager buttons. Search engines like Google follows only plain links and avoid post backs.
- Works with any data list control: Repeater, DataList, GridView or ListView.