<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>YTechie.com &#187; wpf</title>
	<atom:link href="http://www.ytechie.com/category/wpf/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ytechie.com</link>
	<description>Productive software development using ASP.NET, C#, Adobe Flex, and other technologies and tools.</description>
	<lastBuildDate>Fri, 06 Nov 2009 21:16:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Disabling WPF DataGrid Virtualization</title>
		<link>http://www.ytechie.com/2008/09/disabling-wpf-datagrid-virtualization.html</link>
		<comments>http://www.ytechie.com/2008/09/disabling-wpf-datagrid-virtualization.html#comments</comments>
		<pubDate>Wed, 03 Sep 2008 18:39:01 +0000</pubDate>
		<dc:creator>superjason</dc:creator>
				<category><![CDATA[wpf]]></category>

		<guid isPermaLink="false">http://www.ytechie.com/2008/09/disabling-wpf-datagrid-virtualization.html</guid>
		<description><![CDATA[Recently, Microsoft released a DataGrid for WPF (Windows Presentation Foundation). I&#8217;ve been getting my feet wet in WPF, because I think it&#8217;s the long term direction that Microsoft is pushing UI design into.
The DataGrid they released is only a CTP, not an official release. However, I needed something that worked now, not later for the [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, Microsoft <a href="http://www.codeplex.com/wpf/Release/ProjectReleases.aspx?ReleaseId=14963" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/www.codeplex.com/wpf/Release/ProjectReleases.aspx?ReleaseId=14963&amp;referer=');">released a DataGrid</a> for WPF (Windows Presentation Foundation). I&#8217;ve been getting my feet wet in WPF, because I think it&#8217;s the long term direction that Microsoft is pushing UI design into.</p>
<p>The DataGrid they released is only a CTP, not an official release. However, I needed something that worked now, not later for the utility I&#8217;m writing. I created a list of data, and bound it to the grid, only to watch my bound ComboBoxes lose their mind as I scrolled up and down. After ripping out my hair, I found a simple solution (for the DataGrid issue, not the lost hair). I added this attribute to my DataGrid declaration:</p>
<pre class="xml" name="code">VirtualizingStackPanel.VirtualizationMode="Standard"</pre>
<p>By default, the DataGrid is configured to virtualize it&#8217;s contained controls. That means that as you scroll, the rendered <a href="http://blogs.msdn.com/vinsibal/archive/2008/05/14/recycling-that-item-container.aspx" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/blogs.msdn.com/vinsibal/archive/2008/05/14/recycling-that-item-container.aspx?referer=');">controls are reused, and avoids constantly generating containers</a>.</p>
<p>I&#8217;ve seen this behavior in <a href="http://www.adobe.com/products/flex/" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/www.adobe.com/products/flex/?referer=');">Adobe Flex</a>, and it&#8217;s a useful feature to have, especially when memory is a concern. A real world example is the Outlook message list. If you have 10,000 items sitting in your inbox (I&#8217;ve seen it!), you don&#8217;t want to wait while your computer busily tries to display things you can&#8217;t see.</p>
<p>Back to the issue I had. There is either a bug in the DataGrid with ComboBox items, or there I am doing something wrong in my XAML. Either scenario is certainly plausible. When new versions of the DataGrid are released, I&#8217;ll have to give them a try. For now, this fix works great.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ytechie.com/2008/09/disabling-wpf-datagrid-virtualization.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
