Results 1 to 4 of 4

Thread: How to sort numeric and string value in dataview

  1. #1
    Join Date
    May 2008
    Posts
    248

    How to sort numeric and string value in dataview

    I Need to set the values which will be having numeric as well as string values. such as 1,2 ,3 and like xc1,xc2. And willing to sort out these values by the numbers first and then the string values, but sorting these value would be displayed in dataview or datatable, I have tried out this and search lot related to this on the internet but endup with the clueless. And also let me know Is there any way to use IComparable interface to sort dataview data.

    Thanks to those who help.

  2. #2
    Join Date
    Mar 2008
    Posts
    192

    Re: How to sort numeric and string value in dataview

    I think these numbers are being sorted as a string. If you add a simple XML file with no schema (with int and string elements) to the Data Source Catalog and open the Sort & Group dialog for the Data View you get the choice of sorting on elements containing numeric values as numeric values - and not as strings.check whether you have taken the datatype of datafield as integer or long. If not try this and tell me what happens....

  3. #3
    Join Date
    Jan 2009
    Posts
    140

    Re: How to sort numeric and string value in dataview

    I am wondering whether you solve this problem, because I have the same
    issue as you.

    Select the desired sort field in the dialog.
    Edit the XSL - look for the dvt_1.body template, find the xsl:for-each and the
    In my situation, I receive a xml file where one node is decimal or
    empty. for example
    <price>11</price>
    <price>2</price>
    xsl:sort within it that selects your sort field - add the attribute data-type="number"

  4. #4
    Join Date
    Jan 2009
    Posts
    99

    Re: How to sort numeric and string value in dataview

    Could you please check if the SCE agent on those problemaic Windows XP is 6.06278.0? You will find this information from add/remove program. In VB.NET, the syntax for sorting is :
    Dataview.Sort = "Sort-Order Desc/Asc"
    That's why I asked you to enclose it in quotes. Anyways, the solution could be something else. I will suggest using a slightly different Profile Provider than what comes in ASP.NET by default.

Similar Threads

  1. Replies: 3
    Last Post: 04-01-2011, 01:25 AM
  2. Control numeric String in java
    By Gillian Anderson in forum Software Development
    Replies: 5
    Last Post: 12-03-2010, 01:07 PM
  3. Sort listing a TreeMap with String
    By Ash maker in forum Software Development
    Replies: 5
    Last Post: 17-02-2010, 05:14 AM
  4. Confused over DataTable, DataView and DataGrid
    By Lawford in forum Software Development
    Replies: 5
    Last Post: 12-02-2010, 03:34 AM
  5. Replies: 3
    Last Post: 11-06-2009, 10:23 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,269,235.97480 seconds with 17 queries