Click here to Skip to main content
11,414,234 members (72,859 online)
Rate this: bad
Please Sign up or sign in to vote.
I have loaded a xml into my project and used xmltransform class to apply the Xslt so that it would sort the document by a particular column (while also using Xpath). I need to be able to change the sorting on the page to different columns by changing a Dropdownlist.

I have tried various different ways, but with no success --- Does anyone have any Ideas?
Posted 1-Jun-10 0:39am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

For this you need to pass Dropdownlist value to XSL using parameter and based on param value which you have received in XSL apply xsl:sort statement. Roughly you need to do following

XslCompiledTransform tras = new XslCompiledTransform();
XsltArgumentList argList = new XsltArgumentList();
argList.AddParam("sortfield", "", "dd value");
tras.Transform("XMLfile", argList, sw);

XSL Header

<xsl:output method="html" indent="yes"/>
<xsl:param name="sortfield"></xsl:param>

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 9,035
1 OriginalGriff 7,387
2 Maciej Los 3,640
3 Abhinav S 3,298
4 Peter Leow 3,084

Advertise | Privacy | Mobile
Web02 | 2.8.150427.2 | Last Updated 2 Jun 2010
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100