Are We Still Supposed to Use GridView?

J

Jonathan Wood

I'm just starting to get up to speed with ASP.NET. Based on what I've read,
I use the GridView control to display tables of data from a database. And,
using ObjectDataSource, I've found examples of how to implement efficient
paging in the GridView control.

But all my books are for .NET 2.0. Looking around, I see sites like
http://geekswithblogs.net/ranganh/archive/2007/12/06/117426.aspx that say
"DataPager Server Control which combined with List View can provide a
flexible paging mechanism with full customization support. The built-in
paging mechanism of DataGrid, GridView etc., provide little support for
customization."

To be honest, I have no idea what the DataPager or the ListView controls do.
Does someone who knows tell me what, if any, reason I would have for
switching from GridView and ObjectDataSource to something like DataPager and
ListView?

Thanks!
 
M

Michael Nemtsev [MVP]

Hello Jonathan,

ListView/DataPager are new ASP.NET 3.5 component which aimed to be used instead
of GridView.
Just new level of abstraction to incorporate the latest .NET 3.5 features
in these controls

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


JW> I'm just starting to get up to speed with ASP.NET. Based on what
JW> I've read, I use the GridView control to display tables of data from
JW> a database. And, using ObjectDataSource, I've found examples of how
JW> to implement efficient paging in the GridView control.
JW>
JW> But all my books are for .NET 2.0. Looking around, I see sites like
JW> http://geekswithblogs.net/ranganh/archive/2007/12/06/117426.aspx
JW> that say "DataPager Server Control which combined with List View can
JW> provide a flexible paging mechanism with full customization support.
JW> The built-in paging mechanism of DataGrid, GridView etc., provide
JW> little support for customization."
JW>
JW> To be honest, I have no idea what the DataPager or the ListView
JW> controls do. Does someone who knows tell me what, if any, reason I
JW> would have for switching from GridView and ObjectDataSource to
JW> something like DataPager and ListView?
JW>
JW> Thanks!
JW>
 
P

Patrice

The ListView control allows to define the whole markup that is rendered
making it extremely flexible and customizable. So each time you have to
render a grid like control just pick the one that best fit your needs,
either the GridView if it fit your needs or the ListView is you need to take
full control on the rendered markup.

Also you(ll find an overview for each control in the doc :
From http://msdn2.microsoft.com/en-us/library/bb398790.aspx
 
J

Jonathan Wood

Right. I'm just trying to get a feel for if I should switch or stick with
GridView.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,905
Latest member
Kristy_Poole

Latest Threads

Top