Click here to Skip to main content
12,896,826 members (58,550 online)
Rate this:
 
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 31-May-10 23:39pm

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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.170424.1 | Last Updated 2 Jun 2010
Copyright © CodeProject, 1999-2017
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