   [.net] Sort column in dataview
  HelloI have a column in a dataview that I want to sort.The datatype is string.The values are like: "0 %" "10.2 %" etcHow do I implement sorting on values like those? I can not convert the datatype to int (and skip %).But if I have int's, you sort like "dataview.sort = 'mycolumn DESC'".Now I want integer sorting on those strings above.Does anyone have information about how to implement this sort?(Im using VS2003)Thanks!   
  Hrmm... how are you attaining the data?  Can you sort the information before putting it into the DataView?   ;  Right now I get the information from a database.Then I calculate the values (0%, 10.5% for instance) for each row (the calculation is done when doing a search).So yes, I can do the sort in that step, but it should be possible to do it another way too :)I've used the property "ListView.Sort" earlier (when having datatype=double). But now I've changed it to String). So I want to use the "same" sorting-method.A few places are dependent on this kind of sort (the data-layer is not sorted, but the presentation layer is (via the property ListView.Sort)).So I do not want to change the order of the data-layer. Only the presentation-layer.Isn't it possible to create a class that extends from IComparable (implement Compare(object, object))? And then having all rows compared, using that method?   ;  I believe you could be correct(I'm learning as I go along with you on this one). A description of the IComparable class.You could use something like String.Compare(stringx, stringy);Then sort based on your result.This code project article could help.   ;  Hello StriderIt is possible to use BoundColumn and its property DataFormatString, to give the presentation layer another look (the data is double, but the presentation will be string (% added)).This is possible in web-development.But I can't find a similiar solution in application-development.Do you have (or anybody else) any ideas?   ;  Well, this whole sort thing was fixed in .NET 2.0, you can actually sort text using the "dataview.sort = 'mycolumn DESC'" example you gave a couple days ago.  I'm gonn have to look into it some more honestly.   ;  Hi againI found one property of the DataGridTextBoxColumn class: DataGridTextBoxColumn.Format = "#.000 %";"#.000 %" gives 3 decimals and adds a % sign next to the value.So, this is one solution I found.Much less job than having it done by implementing a custom comparer :)   