Click here to Skip to main content
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 Dnyaneshwar@Pune 719
1 CHill60 240
2 Sergey Alexandrovich Kryukov 220
3 TheRealSteveJudge 220
4 CPallini 200
0 Sergey Alexandrovich Kryukov 9,078
1 OriginalGriff 6,771
2 Peter Leow 4,282
3 Zoltán Zörgő 3,809
4 Richard MacCutchan 2,661

Advertise | Privacy | Mobile
Web04 | 2.8.150128.1 | 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