<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Improving Microsoft DataGrid CTP sorting performance</title><link>http://blogs.msdn.com/jgoldb/archive/2008/08/26/improving-microsoft-datagrid-ctp-sorting-performance.aspx</link><description>Summary: As you may know Microsoft released a Community Tech Preview (CTP) of the DataGrid control. See the posting here . Once you start using the DataGrid CTP, load many elements to it and you use the default, built-in sort (by simply clicking on the</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>send flowers &amp;raquo; Improving Microsoft DataGrid CTP sorting performance</title><link>http://blogs.msdn.com/jgoldb/archive/2008/08/26/improving-microsoft-datagrid-ctp-sorting-performance.aspx#8898811</link><pubDate>Wed, 27 Aug 2008 05:55:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8898811</guid><dc:creator>send flowers &amp;raquo; Improving Microsoft DataGrid CTP sorting performance</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://hubsfunnywallpaper.cn/?p=2472"&gt;http://hubsfunnywallpaper.cn/?p=2472&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Improving Microsoft DataGrid CTP sorting performance</title><link>http://blogs.msdn.com/jgoldb/archive/2008/08/26/improving-microsoft-datagrid-ctp-sorting-performance.aspx#8899857</link><pubDate>Wed, 27 Aug 2008 16:00:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8899857</guid><dc:creator>sich</dc:creator><description>&lt;p&gt;This example could be even several times faster if the switch construction was put in the constructor, and sorting code was stored as delegate, as the sorting column is never changed in comparer instance after it's creation :)&lt;/p&gt;
</description></item><item><title>More DataGrid Samples: Custom Sorting, Drag and Drop of rows, Column Selection, and Single-click Editing</title><link>http://blogs.msdn.com/jgoldb/archive/2008/08/26/improving-microsoft-datagrid-ctp-sorting-performance.aspx#8900062</link><pubDate>Wed, 27 Aug 2008 16:52:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8900062</guid><dc:creator>Vincent Sibal's Blog</dc:creator><description>&lt;p&gt;Jossef just wrote this great post on improving sorting in the DataGrid through a custom sort. Check it&lt;/p&gt;
</description></item><item><title>re: Improving Microsoft DataGrid CTP sorting performance</title><link>http://blogs.msdn.com/jgoldb/archive/2008/08/26/improving-microsoft-datagrid-ctp-sorting-performance.aspx#8900086</link><pubDate>Wed, 27 Aug 2008 17:01:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8900086</guid><dc:creator>sich</dc:creator><description>&lt;p&gt;I have already checked, great article :)&lt;/p&gt;
</description></item><item><title>Improving Microsoft DataGrid CTP sorting performance - Part 2</title><link>http://blogs.msdn.com/jgoldb/archive/2008/08/26/improving-microsoft-datagrid-ctp-sorting-performance.aspx#8904238</link><pubDate>Fri, 29 Aug 2008 01:05:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8904238</guid><dc:creator>WPF Performance</dc:creator><description>&lt;p&gt;In this blog I wrote how you can improve Microsoft DataGrid CTP by providing your own custom sort.&amp;amp;#160;&amp;amp;#160;&lt;/p&gt;
</description></item><item><title>re: Improving Microsoft DataGrid CTP sorting performance</title><link>http://blogs.msdn.com/jgoldb/archive/2008/08/26/improving-microsoft-datagrid-ctp-sorting-performance.aspx#8904498</link><pubDate>Fri, 29 Aug 2008 07:57:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8904498</guid><dc:creator>jgoldb</dc:creator><description>&lt;p&gt;Hi Sich&lt;/p&gt;
&lt;p&gt;I updated my sample and, now I am using delegate and I am seeing additional 50% gain.&lt;/p&gt;
&lt;p&gt;See: &amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/jgoldb/archive/2008/08/28/improving-microsoft-datagrid-ctp-sorting-performance-part-2.aspx"&gt;http://blogs.msdn.com/jgoldb/archive/2008/08/28/improving-microsoft-datagrid-ctp-sorting-performance-part-2.aspx&lt;/a&gt; &lt;/p&gt;
</description></item><item><title>Possible issue with sorting when string values are null</title><link>http://blogs.msdn.com/jgoldb/archive/2008/08/26/improving-microsoft-datagrid-ctp-sorting-performance.aspx#8952199</link><pubDate>Mon, 15 Sep 2008 11:05:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8952199</guid><dc:creator>Kirkaiya</dc:creator><description>&lt;p&gt;First, thanks for the great coding example - I ended up using your method on a WPF ListView control, which made actually usable (my app has ~ 20,000 rows).&lt;/p&gt;
&lt;p&gt;I did have one issue, where the string properties of some items in the ObservableCollection(Of T) were null (or Nothing, in my case, since I ported it to VB.Net). &amp;nbsp;The data was coming from a Linq query.&lt;/p&gt;
&lt;p&gt;The way I solved this was to concatenate the value with an empty string (in the mySort switch/Select list), like this:&lt;/p&gt;
&lt;p&gt;Case &amp;quot;FirstName&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; myCompare = Function(a, b) (a.FirstName &amp;amp; &amp;quot;&amp;quot;).ToString.CompareTo((b.FirstName &amp;amp; &amp;quot;&amp;quot;).ToString) * dir&lt;/p&gt;
&lt;p&gt;I ran your original C# code, adding some items with null values, and it has the same problem, so not just a language issue. &amp;nbsp;Many thanks :-)&lt;/p&gt;
</description></item><item><title>re: Improving Microsoft DataGrid CTP sorting performance</title><link>http://blogs.msdn.com/jgoldb/archive/2008/08/26/improving-microsoft-datagrid-ctp-sorting-performance.aspx#9550401</link><pubDate>Wed, 15 Apr 2009 12:16:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9550401</guid><dc:creator>khataev</dc:creator><description>&lt;p&gt;Could you explain why we need to invoke StandardSortingDone this way?&lt;/p&gt;
&lt;p&gt;Dispatcher.BeginInvoke(DispatcherPriority.Normal, new NoArgDelegate(StandardSortingDone));&lt;/p&gt;
&lt;p&gt;I see that estimated time is being counted wrong if not to use dispatcher's begininvoke method, but cannot understand it -)&lt;/p&gt;
</description></item><item><title>re: Improving Microsoft DataGrid CTP sorting performance</title><link>http://blogs.msdn.com/jgoldb/archive/2008/08/26/improving-microsoft-datagrid-ctp-sorting-performance.aspx#9550582</link><pubDate>Wed, 15 Apr 2009 14:34:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9550582</guid><dc:creator>khataev</dc:creator><description>&lt;p&gt;And I'd appreciate if You explain why the second way gives additional gain? Is it by avoiding extra &amp;quot;case&amp;quot; conditions checks?&lt;/p&gt;
</description></item></channel></rss>