Click here to Skip to main content
Rate this: bad
good
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
good
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
 
C# CODE
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>
  Permalink  

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 450
1 OriginalGriff 180
2 DamithSL 130
3 Dave Kreskowiak 120
4 Suvendu Shekhar Giri 110
0 OriginalGriff 7,645
1 DamithSL 5,614
2 Sergey Alexandrovich Kryukov 5,344
3 Maciej Los 4,961
4 Kornfeld Eliyahu Peter 4,539


Advertise | Privacy | Mobile
Web02 | 2.8.141223.1 | Last Updated 2 Jun 2010
Copyright © CodeProject, 1999-2014
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