ASP.NET 2.0 sort DataList without query again

H

hohans

Hi All,

In 2.0, how do you sort DataList without executing the query again?

So far what I found in the Web all show examples where you need to
re-execute the query against DB with passed in field name and sort
direction. The data source has been bound to the control. Can we
somehow just retrieve it, sort it and bind it again? Any ideas will be
truely appreciated.

Hans
 
A

Axel Dahmen

Hi Hans,

actually what happens when you bind a data control do a data source is that
it reads the data contained in the data source and creates html from it when
you call the DataBind() function. It doesn't store the data source any
further than that.

The syntax is a bit confusing, I must admit. It would have been simpler to
understand if there wasn't a DataSource property and if the DataBind()
function had the data source as its sole parameter, like
"DataBind(myDTable);".

HTH,
www.sportbootcharter.com
Axel Dahmen
 
H

hohans

Hi Axel

or anyone who would like to give input:

If the data source bound to a control is just for reading, then how
does it maintain view state? Remeber when EnabledViewState is true, it
is supposed to (actually it does do) display the same data accross page
postback, right?

Hans
 

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

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top