What is the major difference between GridView/DetailsView/FormView in ASP.net [closed]
Asked Answered
G

7

6

What are the similarities and differences between GridView, DetailView, FormView?

What are use case scenarios for when you would use each of these controls and why?

Genitive answered 28/12, 2008 at 8:11 Comment(1)
This should be opened back up. Furthermore when voting to close the users should leave comments for improvement so that the community understand how to formulate better questions. Also consider just editing, just closing is lazy.Phagocytosis
O
1

GridView shows them all like an HTML table. If you click on a key in a row, DetailView shows the details for the row in a separate space. If you need to insert a new row, FormView appears also in a separate space.

Oleander answered 28/12, 2008 at 8:38 Comment(0)
A
12

Formview is intended for insert/update/view of a single record.

DetailsView is intended for the displaying of a single record with optional support for paging and navigation.

GridView is intended to primarily to display/update multiple records. It's considered a replacement for the DataGrid control from .NET 1.1.

Alcoholism answered 29/12, 2008 at 14:44 Comment(1)
DetailsView also supports edit/delete/insert. Look here.Shelve
M
5

Well, I'd read the ASP.Net QuickStart Tutorials which give a good overview of each control:

ASP.NET Quickstart Tutorials

If you're displaying "tabular" data, then you're probably going to use DetailsView as it's designed for master-detail relationships and has tabular rendering built-in (FormsView does not)

Manner answered 28/12, 2008 at 8:39 Comment(0)
K
1

Form view is data bound it is user interface control, but details view has a build in tabular rendering

Karttikeya answered 28/12, 2008 at 8:11 Comment(0)
O
1

GridView shows them all like an HTML table. If you click on a key in a row, DetailView shows the details for the row in a separate space. If you need to insert a new row, FormView appears also in a separate space.

Oleander answered 28/12, 2008 at 8:38 Comment(0)
P
0

GridView supports editing. You can use commands edit, update, delete, in ButtonField, ImageButton, Hyperlink etc. used as a template. In addition if we specify autogenerate deletebutton, autogenerate editbutton properties of GridView it will add the columns for it.

Pyrazole answered 7/12, 2012 at 13:51 Comment(1)
Please use capital letters as appropriate in your answers.Planck
B
0

Form View:Form view control enable us to view single record at a time. And we can customize the page depends upon your requirement and place more control over the layout.

Details View:Details View also view single record at a time. And details view result its like HTML table.

Burger answered 13/6, 2013 at 5:42 Comment(0)
T
-1

Gridview is use to view data only, we can't do any modification (editing or inserting is not possible).

Dataview is use to view, edit or insert data.dataview has built in tabular rendering.it will generate them for you in a straight top to down list with no possibility of moving them around to make them more user friendly.

In formview, you can position the element wherever you want them on the page.it means formview provide user define template for its rendering..

Thunderous answered 18/3, 2010 at 6:30 Comment(2)
Is this correct? As I understand it, GridView does permit editing...Aliquant
Very wrong information in first lineFlock

© 2022 - 2024 — McMap. All rights reserved.