GridView vs DataList vs Repeater vs Formview vs DetailsView - which one to choose

Rate It (1)

Last post 07-17-2008 2:53 AM by hooplafoo. 12 replies.

Sort Posts:

  • GridView vs DataList vs Repeater vs Formview vs DetailsView - which one to choose

    02-06-2007, 10:17 AM

    In development there is always a question which control to choose. I think many developers including myself are not clear on which control should be should for which purposes.

    Can you pls explain what are the pros and cons of these controls and also why some say that Gridview is a heavy control and repeater is a light control what does that mean. what makes a control heavy and what makes a control light......does it really matter in professional applications  which control you use?

    kindly throw some light. thanks.

  • Re: GridView vs DataList vs Repeater vs Formview vs DetailsView - which one to choose

    02-06-2007, 11:32 AM

    Still kind of new myself, but this is what my book says:

    Control - Capabilities 

    GridView - Read/Edit

    DataList - Read/Edit

    Repeater - Read Only

    DetailsView - Read/Edit/Create

    FormView - Read/Edit/Create 

    I pick a control based on what I want to do, then practice with it.  Before I got this book, I didn't know which control to use for certain things.   

    Not sure about the heavy/light thing.  Maybe because the GridView is a more detailed?  I don't know. 

     


    "Sometimes I spend so much time going the wrong direction on a problem. K.I.S.I.S = Keep It Simple I'm Stupid :)"

    Matt
  • Re: GridView vs DataList vs Repeater vs Formview vs DetailsView - which one to choose

    02-06-2007, 11:39 AM
    • Loading...
    • AjPtl
    • Joined on 01-25-2007, 3:21 PM
    • DE, USA
    • Posts 257

    Feature

    Repeater

    DataList

    GridView

    Table layout

    No

    No

    Yes

    Flow layout

    Yes

    Yes

    No

    Column layout

    No

    Yes

    No

    Style properties

    No

    Yes

    Yes

    Templates

    Yes

    Yes

    Columns/optional

    Select/ Edit/Delete

    No

    Yes

    Yes

    Sort

    No

    No

    Yes

    Paging

    No

    No

    Yes

    Anuj Patel
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    If this post answers your question please mark it as Answered.
  • Re: GridView vs DataList vs Repeater vs Formview vs DetailsView - which one to choose

    02-06-2007, 2:24 PM

    Thanks a lot for your deailed reply. i still not clear about one thing. what makes a control heavy and light from the software point of view.

    lets say that i can use a repeater or a datalist for doing something but instead of these i choose to use gridview then what diff does it make.......gridview can still do what a repeater can do........so why should i use repeater........what makes repeater lighter then gridview? does it take more time to load gridview then repeater.?

  • Re: GridView vs DataList vs Repeater vs Formview vs DetailsView - which one to choose

    02-06-2007, 2:45 PM

    Ok.  I did a little search on the internet and found this site http://www.webreference.com/programming/asp/viewstate/.  When you get to the page, scroll down about 1/2 way and you'll see some examples of Light/Heavy controls.  I don't know where you heard this information, but I couldn't find much out there on the subject.

     

    What I got out of it 

    It seems as though "Heavy" and "Light" refer to how much ViewState is created for the control.  It looks like the more data, the more heavier it gets.  So I don't think it matters so much which of these controls you use.  They are probably all considered heavy. 

     


    "Sometimes I spend so much time going the wrong direction on a problem. K.I.S.I.S = Keep It Simple I'm Stupid :)"

    Matt
  • Re: GridView vs DataList vs Repeater vs Formview vs DetailsView - which one to choose

    02-23-2007, 11:31 AM
    Answer
    • Loading...
    • Holf
    • Joined on 08-28-2006, 4:14 PM
    • Posts 144

    Hi,

     You'll generally find that the more features a control has, the more 'heavy' it will be. As well as increasing ViewState size, heavier controls also have a greater hit on CPU load and memory requirements.

    Does this matter? It really depends on what sort of load you expect your site to have. If you're coding a simple site on a dedicated box and you only have ten users or so it doesn't really matter what you use. But if you're writing something for many thousands of users and you want to squeeze all you can out of limited hardware, then the use of a GridView when you could better use a less heavy DataGrid can make all the difference.

    Bear in mind that ViewState size can also be a problem in itself. ViewState can add tens of kilobytes to a page size, which doesn't seem too bad unitl you consider the impact this has with thousands of users. The monthly bandwidth that your hosting provider allows you is suddenly getting eaten up much more quickly. 

    Personally I always try to use the simplest control necessary to do the job, because usually that will be the most efficient way to do it.

  • Re: GridView vs DataList vs Repeater vs Formview vs DetailsView - which one to choose

    02-23-2007, 11:43 AM
    • Loading...
    • Holf
    • Joined on 08-28-2006, 4:14 PM
    • Posts 144

    I should add something here on performance in general:

    Although choosing the appropriate control will make a difference to performance, this difference is not usually huge. Such performance considerations only make sense if you are treating performance seriously from all angles. For example, establishing a data-caching strategy, making sure you are only retreiving relevant data result-sets when paging, deciding on how best to pass data around between layers etc... these are all probably more important. It is only when you apply all these techniques that the sum total of the parts starts to make a real difference, performance-wise.

  • Re: GridView vs DataList vs Repeater vs Formview vs DetailsView - which one to choose

    02-23-2007, 12:55 PM
    • Loading...
    • kblackwell
    • Joined on 02-19-2007, 9:26 PM
    • Posts 46

    Hi guys,

    I started a thread yesterday along similar lines:  http://forums.asp.net/thread/1591020.aspx

    I'm a bit confused on what control to use.  I want to be able to edit, and I want to be able to the editable data elements into a table.

    Right now I've got my stuff in a DetailsView, but found I can't put those data controls into a table. Sad

     

  • Re: GridView vs DataList vs Repeater vs Formview vs DetailsView - which one to choose

    02-23-2007, 1:37 PM

    Based on what I've read in your other post (edit capability and table structure), and of course my newbie knowledge of this ASP stuff, I would suggest a FormView if you truly want complete control over everything.  I haven't used it much (again, I'm new), but I think you can do exactly what you want.

    Here is a super-good tutorial on ASP 2.0. http://msconline.maconstate.edu/tutorials/default.aspx

    FormView Editing Example -  http://msconline.maconstate.edu/tutorials/ASPNET20/ASPNET09/aspnet09-03.aspx

    Another FormView Editing Example - http://msconline.maconstate.edu/tutorials/ASPNET20/ASPNET09/aspnet09-06.aspx

    In those links, under the heading "Coding the FormView" it shows a FormView with a table structure nested inside of templates.  I hope this helps.  If you need anything else, write back. Big Smile


    "Sometimes I spend so much time going the wrong direction on a problem. K.I.S.I.S = Keep It Simple I'm Stupid :)"

    Matt
  • Re: GridView vs DataList vs Repeater vs Formview vs DetailsView - which one to choose

    02-23-2007, 1:54 PM
    • Loading...
    • kblackwell
    • Joined on 02-19-2007, 9:26 PM
    • Posts 46

    Hey, thanks!

    I'll investigate those links shortly!

     

  • Re: GridView vs DataList vs Repeater vs Formview vs DetailsView - which one to choose

    02-25-2007, 12:15 PM
    • Loading...
    • wildert
    • Joined on 10-12-2005, 8:35 PM
    • Posts 19
    Important to note the FormView, GridView, and Datalist have Designer-Side databinding capabilities using Smarttags on both the Control itself and all controls dropped inside them. This was Sooo important to me because it Truely allows for a nearly pure UI layer with minimal code. All controls should have databinding smarttags like these controls do.
  • Re: GridView vs DataList vs Repeater vs Formview vs DetailsView - which one to choose

    03-06-2008, 1:25 PM
    • Loading...
    • ccatto
    • Joined on 07-17-2007, 12:50 AM
    • Boca Fl
    • Posts 3

     

    Thank you everyone this was a very helpful post.

    Catto

    Catto
  • Re: GridView vs DataList vs Repeater vs Formview vs DetailsView - which one to choose

    07-17-2008, 2:53 AM
    • Loading...
    • hooplafoo
    • Joined on 01-24-2007, 5:41 PM
    • Posts 17

    How do you cast a listitem into a typed object that was bound to collection of those typed objects?  I was only able to get to work with a datalist... If anyone can point out how to do that with alist view that would be helpful...

     how to do this with the items noted above?

    oObjectType o = new oObjectType ();
    o = (
    oObjectType )e.Item.DataItem;

    .Net<3.5> HardCore<commando>
Page 1 of 1 (13 items)
Microsoft Communities