Hi Mike,
My guess is that you could create a wrapper class for your HTML snippets
that would implement the IComparable interface and ensure the expected sort
order. This class should also override the ToString() method to return the
HTML snipper content, and it should have a constructor creating an instance
from a string passed as well as type conversion operators making it
interchangeable with the System.String class.
An easier solution could exist, but I cannot currently think of anything
simpler. Please treat this as an "off the top of my head" idea.
--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE
"Mike Irwin" <mi**@faroutfreakyshit.com> wrote in message
news:uU**************@TK2MSFTNGP10.phx.gbl...
I set up sorting by various columns for a DataGrid. For one of the
columns, I would like to implement my own sort algorithm, though. For example, the
column contains data like:
<a href="http://www.example.com">DEF</a>
<a href="http://www.test.somedomain">ABC</a>
If I sort by the default algorithm, I get 'DEF' before 'ABC' because the
strings are compared up until they differ after 'www.'. What I would like
to do is somehow sort on the strings 'DEF' and 'ABC'. Is this possible?
Can I somehow implement a custom sort algorithm and then use it from a
DataGrid or DataView?