Sorting underlying data

B

Björn Wandel

Hello all.

I'm sort of a newbe on asp.net. It is common in web apps to show a table of
items of some sort to the user. Some columns contain links to pages where
the user can edit that particular item.

My problem is this: How do you sort on the underlying data (in a dataview),
and not on the complete html text?

This HTML code illustrates the problem. In this case the sorting (ASC) is
done correctly:

<a href="b">Value A</a>
<a href="a">Value B</a>

But when i sort this column (ASC), the order is ofcourse reversed since the
sorting is not done on the underlying data. Any ideas?

Regards,
Björn
 
E

Elton Wang

Hi Björn,

Suppose you want to sort fieldA (ASC), fieldC (DESC),
you can do it

dataview.Sort = "fieldA ASC, fieldC DESC";

HTH,

Elton Wang
(e-mail address removed)
 

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,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top