views:

59

answers:

2

I have a requirement where I would not know the columns and any result set information at design-time, so I'd be generating the data-display control dynamically.

What is the most suitable way to display this type of information on-the-fly in a table/grid like structure on an ASP.NET page considering the following parameters (in order of importance):

  1. Performance
  2. Extensibility
  3. Usability

I know I can dynamically generate a gridview/repeater/listview control but what I'd like to understand is which option (from stated ones or any other beyond these) would be an optimal solution.

P.S. Paging and Sorting are part of desired functionalities, but can be overlooked if the solution is overwhelming. :)

Thanks for the help!

A: 

Columns and rows with sorting and paging: If you wanna include adding, deleting, selecting, and editing with that I'll go with gridview.

pymendoza
+1  A: 

I think the performance depends a lot on the data provider: paging and sorting (and filtering) the data are easily the most expensive tasks when dealing with databases - so picking a renderer (GridView/listview/repeater) is more dependent on your comfort with that particular control.

In terms of extensibility options - Repeater is obviously the least "heavy" - but you're definitely committing to maintaining a glob of code that loops over and wraps your data and transforms it into "columns" (manually writing elements?) in your repeaterItems. GridView seems to give better row AND column support.

Usability: I'd really investigate some of the more modern techniques of allowing sorting/paging on grids that use AJAX - it is definitely made easier by ASP.NET AJAX or yes, I'm going to say it, jQuery. The basic concept of what I'm suggesting is: serve up the data via web methods (ScriptService attribute) to a Javascript that will render the table on the browser and handle paging/sorting requests (AJAX calls back to the ScriptService). It is more responsive and generally allows richer UIs than the built-in controls. Check out jQGrid.

Jeff Meatball Yang
^^ so do you mean rather than creating a server-side control, I should create a client-side HTML Table and handle the entire data bringing job through AJAX?
Dienekes