I want to know what is difference between DataList and GriedView.
Thank you.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted May 30, 2012, 12:18 PM
DataGrid and DataList controls are derived from the WebControl class, while the Repeater control is derived from the Control class. The WebControl class contains a number of aesthetic properties, such as BackColor, ForeColor, CssClass, BorderStyle and so on.
In ASP .NET basically there are three kinds of the Data Presentation Controls.
- GridView or DataGrid
- DataList
- Repeater
List of different abilities of Repeater Control, Datalist Control and GridView Control features.Features of a GridView:
- Alternate item
- Header
- Footer
- Colors, font, borders, etc.
- Paging
Features of Repeater:- List format
- No default output
- More control
- More complexity
- Item as row
- Not updateable
Features of DataList:- Directional rendering
- Good for columns
- Item as cell
- Alternate item
- Updateable
Difference between Datagrid,DataList and Data Repeater:- Datagrid has paging while Datalist doesnt.
- Datalist has a property called repeat. Direction = vertical/horizontal. (This is of great help in designing layouts). This is not there in Datagrid.
- A repeater is used when more intimate control over html generation is required.
- When only checkboxes/radiobuttons are repeatedly served then a checkboxlist or radiobuttonlist are used as they involve fewer overheads than a Datagrid.
The Repeater repeats a layout of HTML you write, it has the least functionality of the three. DataList is the next step up from a Repeater; accept you have very little control over the HTML that the control renders. DataList is the first of the three controls that allow you Repeat-Columns horizontally or vertically. Finally, the DataGrid is the motherload. However, instead of working on a row-by-row basis, you're working on a column-by-column basis. DataGrid caters to sorting and has basic paging for your disposal. Again you have little contro, over the HTML. NOTE: DataList and DataGrid both render as HTML tables by default.GridView example:
DataList Example:
DataList in ASP.NET using C#
DataSourceID="SqlDataSource1"
Font-Bold="True" Font-Names="Verdana" Font-Size="Small" GridLines="Both" RepeatColumns="2"
RepeatDirection="Horizontal" Width="463px">
Student Information
Name:
DOB:
Age:
Course:
Branch:
City:
MobileNo:
SelectCommand="SELECT * FROM [Student]">
Repeater Example:
<%# DataBinder.Eval(Container.DataItem, "TestEnglish") %>
<%# DataBinder.Eval(Container.DataItem, "TestMath") %>
******
<%# DataBinder.Eval(Container.DataItem, "TestEnglish") %>
<%# DataBinder.Eval(Container.DataItem, "TestMath") %>
End of the funky stuff
SelectCommand="SELECT * FROM [Student]">
Please refer the below link
http://24x7aspnet.blogspot.in/2009/06/feature-difference-between.html
Thanks
VulpesPosted May 30, 2012, 11:05 AM
http://weblogs.asp.net/anasghanem/archive/2008/09/06/comparing-listview-with-gridview-datalist-and-repeater.aspx
Chintan RathodPosted May 30, 2012, 10:53 AM
Features of a GridView:
Features of DataList:
Thanks & Regards----------------
Chintan Rathod