Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 21-07-2009
Member
 
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.
Reply With Quote
  #2  
Old 21-07-2009
Member
 
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....
Reply With Quote
  #3  
Old 21-07-2009
Member
 
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"
Reply With Quote
  #4  
Old 21-07-2009
Member
 
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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to sort numeric and string value in dataview"
Thread Thread Starter Forum Replies Last Post
What is the difference between binary tree sort and heap sort in data structure sRIPRIYA Software Development 3 04-01-2011 01:25 AM
Control numeric String in java Gillian Anderson Software Development 5 12-03-2010 01:07 PM
Sort listing a TreeMap with String Ash maker Software Development 5 17-02-2010 05:14 AM
Confused over DataTable, DataView and DataGrid Lawford Software Development 5 12-02-2010 03:34 AM
Error: "Arithmetic overflow error converting numeric to data type numeric." Nthing Software Development 3 11-06-2009 10:23 AM


All times are GMT +5.5. The time now is 07:40 PM.