<?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>WPF DataGrid: Dissecting the Visual Layout</title><link>http://blogs.msdn.com/b/vinsibal/archive/2008/08/14/wpf-datagrid-dissecting-the-visual-layout.aspx</link><description>I’m going to be dissecting and discussing the DataGrid visuals and how they are all assembled together to form the overall DataGrid. Note: This is really more of a post for people who want to understand how the DataGrid works internally. I’m not going</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: WPF DataGrid: Dissecting the Visual Layout</title><link>http://blogs.msdn.com/b/vinsibal/archive/2008/08/14/wpf-datagrid-dissecting-the-visual-layout.aspx#9965189</link><pubDate>Wed, 17 Feb 2010 17:35:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9965189</guid><dc:creator>Steve Miller</dc:creator><description>&lt;p&gt;Vince,&lt;/p&gt;
&lt;p&gt;When I set the DataGrid property for HeadersVisibility to 'None' I get the following binding errors during runtime (listed below). &amp;nbsp;I have a grid that I want no headers shown. &amp;nbsp;If I set the property to 'Column' or 'Row' (or anything but 'None') the binding errors go away. &amp;nbsp;Is there a fix or a workaround? &amp;nbsp;I know the warning is harmless, but I want to fix all errors or warnings that appear in the output window of Visual Studio to be certain the xaml is completely correct. &amp;nbsp;I think this is a bug.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Steve&lt;/p&gt;
&lt;p&gt;-----------------------&lt;/p&gt;
&lt;p&gt;System.Windows.Data Error: 39 : BindingExpression path error: 'IsSelected' property not found on 'object' ''TotalsDataItem' (HashCode=50423602)'. BindingExpression:Path=IsSelected; DataItem='TotalsDataItem' (HashCode=50423602); target element is 'DataGridRow' (Name=''); target property is 'NoTarget' (type 'Object')&lt;/p&gt;
&lt;p&gt;System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='Microsoft.Windows.Controls.DataGrid', AncestorLevel='1''. BindingExpression:Path=AreRowDetailsFrozen; DataItem=null; target element is 'DataGridDetailsPresenter' (Name=''); target property is 'SelectiveScrollingOrientation' (type 'SelectiveScrollingOrientation')&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9965189" width="1" height="1"&gt;</description></item><item><title>re: WPF DataGrid: Dissecting the Visual Layout</title><link>http://blogs.msdn.com/b/vinsibal/archive/2008/08/14/wpf-datagrid-dissecting-the-visual-layout.aspx#9891775</link><pubDate>Sat, 05 Sep 2009 16:41:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9891775</guid><dc:creator>Jew</dc:creator><description>&lt;p&gt;Hi Vin,&lt;/p&gt;
&lt;p&gt;How can I create a multirow column header?&lt;/p&gt;
&lt;p&gt;Something like this:&lt;/p&gt;
&lt;p&gt;| Alphabet | Number|&lt;/p&gt;
&lt;p&gt;|A | B | C | 1 | 2 |&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9891775" width="1" height="1"&gt;</description></item><item><title>re: WPF DataGrid: Dissecting the Visual Layout</title><link>http://blogs.msdn.com/b/vinsibal/archive/2008/08/14/wpf-datagrid-dissecting-the-visual-layout.aspx#9858724</link><pubDate>Thu, 06 Aug 2009 08:21:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9858724</guid><dc:creator>shailendrasute</dc:creator><description>&lt;p&gt;Thanks Vinsibal for excellent article series.&lt;/p&gt;
&lt;p&gt;This is what I was looking for. &lt;/p&gt;
&lt;p&gt;I was trying to change grid orientation to verticle using control template/style triggers etc. No success.&lt;/p&gt;
&lt;p&gt;pl. suggest some way to achieve this.&lt;/p&gt;
&lt;p&gt;Thanks again&lt;/p&gt;
&lt;p&gt;Shailendra&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9858724" width="1" height="1"&gt;</description></item><item><title>re: WPF DataGrid: Dissecting the Visual Layout</title><link>http://blogs.msdn.com/b/vinsibal/archive/2008/08/14/wpf-datagrid-dissecting-the-visual-layout.aspx#9651315</link><pubDate>Fri, 29 May 2009 04:30:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9651315</guid><dc:creator>cheapsaket</dc:creator><description>&lt;p&gt;I have grouped my data in a datagrid and used a customized expander to hide the toggle button. I have expanded it to the right. The result is shown below.&lt;/p&gt;
&lt;p&gt;&amp;lt;img src&amp;quot;&lt;a rel="nofollow" target="_new"&gt;&lt;a rel="nofollow" target="_new" href="http://i629.photobucket.com/albums/uu13/cheapsaket/datagrid2.png"&gt;http://i629.photobucket.com/albums/uu13/cheapsaket/datagrid2.png&lt;/a&gt;&amp;quot;&amp;gt;"&gt;&lt;a rel="nofollow" target="_new" href="http://i629.photobucket.com/albums/uu13/cheapsaket/datagrid2.png"&gt;http://i629.photobucket.com/albums/uu13/cheapsaket/datagrid2.png&lt;/a&gt;&amp;quot;&amp;gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://i629.photobucket.com/albums/uu13/cheapsaket/datagrid2.png"&gt;http://i629.photobucket.com/albums/uu13/cheapsaket/datagrid2.png&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;My question is how to access/set the value of the column header above group names?&lt;/p&gt;
&lt;p&gt;The layout diagram in the post does not address this area so if you can specify what goes there, it would be helpful.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9651315" width="1" height="1"&gt;</description></item><item><title>re: WPF DataGrid: Dissecting the Visual Layout</title><link>http://blogs.msdn.com/b/vinsibal/archive/2008/08/14/wpf-datagrid-dissecting-the-visual-layout.aspx#9583723</link><pubDate>Sat, 02 May 2009 17:41:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9583723</guid><dc:creator>Vincent Sibal - MSFT</dc:creator><description>&lt;p&gt;Kerry,&lt;/p&gt;
&lt;p&gt;There are a couple things you can do here. &amp;nbsp;You can listen to the AutoGeneratingColumn event and cancel the generation of particular columns or just not do auto-generated columns. &amp;nbsp;Hope that helps.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9583723" width="1" height="1"&gt;</description></item><item><title>re: WPF DataGrid: Dissecting the Visual Layout</title><link>http://blogs.msdn.com/b/vinsibal/archive/2008/08/14/wpf-datagrid-dissecting-the-visual-layout.aspx#9573757</link><pubDate>Tue, 28 Apr 2009 18:55:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9573757</guid><dc:creator>Kerry</dc:creator><description>&lt;p&gt;Hi Vin,&lt;/p&gt;
&lt;p&gt;thank you for doing all this work. I read your artictle and one thing, that is still missing in the picure to me is the DataGridRowHeader. Since I am developing applications for mathematical use, I am very much interested on being able to build a x/Y axis representation of a grid. Getting to it:&lt;/p&gt;
&lt;p&gt;In the four steps above you descibed how each Column gets its data bound and of course I can imagine how to use templates for that. But where does the rowheader get it's data from? If I make an Observable Collection, that contains objecs that have a field for the header this field will also be generated as a column. which really is not what I want :-). So how can I distinguish the Itemsource for the coumn from the Source for the rowheader preventing my rowheader also becoming generated as a colum?&lt;/p&gt;
&lt;p&gt;Many regs, &lt;/p&gt;
&lt;p&gt;Kerry&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9573757" width="1" height="1"&gt;</description></item><item><title>re: WPF DataGrid: Dissecting the Visual Layout</title><link>http://blogs.msdn.com/b/vinsibal/archive/2008/08/14/wpf-datagrid-dissecting-the-visual-layout.aspx#9573553</link><pubDate>Tue, 28 Apr 2009 16:26:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9573553</guid><dc:creator>Stan</dc:creator><description>&lt;p&gt;For DataGridCheckBoxColumn, I was hoping you have sth like CheckedValue = &amp;quot;Y&amp;quot;, CheckedValue = &amp;quot;*&amp;quot;, UncheckedValue = &amp;quot;Whatever&amp;quot;, UncheckedValue = &amp;quot;*&amp;quot;. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9573553" width="1" height="1"&gt;</description></item><item><title>re: WPF DataGrid: Dissecting the Visual Layout</title><link>http://blogs.msdn.com/b/vinsibal/archive/2008/08/14/wpf-datagrid-dissecting-the-visual-layout.aspx#9526518</link><pubDate>Wed, 01 Apr 2009 15:56:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9526518</guid><dc:creator>Vincent Sibal - MSFT</dc:creator><description>&lt;p&gt;sreeraj,&lt;/p&gt;
&lt;p&gt;See this thread, &lt;a rel="nofollow" target="_new" href="http://wpf.codeplex.com/Thread/View.aspx?ThreadId=51923"&gt;http://wpf.codeplex.com/Thread/View.aspx?ThreadId=51923&lt;/a&gt;.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9526518" width="1" height="1"&gt;</description></item><item><title>re: WPF DataGrid: Dissecting the Visual Layout</title><link>http://blogs.msdn.com/b/vinsibal/archive/2008/08/14/wpf-datagrid-dissecting-the-visual-layout.aspx#9525412</link><pubDate>Wed, 01 Apr 2009 09:24:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9525412</guid><dc:creator>sreeraj</dc:creator><description>&lt;p&gt;Hi Vinsibal,&lt;/p&gt;
&lt;p&gt;Hope you are doing fine.&lt;/p&gt;
&lt;p&gt; Am fed up with an issue in wpf datagrid . I have a data grid which is having check boxes in first column . Also i have a checkbox outside the Datagrid . When am cheking the checkbox outside the datagrid, i want all the checkboxes inside the grid . I tried implementing this in the following way(Code attached along with this) , but it is showing strange behaviour . Some checkboxes in rows randomly getting checked(if some more clearly says first 10 rows are getting checked after that say 5 not checked again next 10 getting checked &amp;nbsp;and this process continues till the end of records). I have tried solvint this issue using the helper class in the demo application you have published, but still it is showing same behaviour. &amp;nbsp;I dont know why this happening . Am attaching my code here . &lt;/p&gt;
&lt;p&gt;Please suggest a solution &lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;sreeraj &lt;/p&gt;
&lt;p&gt;-----------XAML For Grid------------------&lt;/p&gt;
&lt;p&gt;&amp;lt;dg:DataGrid Grid.Row=&amp;quot;1&amp;quot; AutoGenerateColumns=&amp;quot;False&amp;quot; AlternatingRowBackground=&amp;quot;SkyBlue&amp;quot; RowDetailsVisibilityMode=&amp;quot;Collapsed&amp;quot; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AllowDrop=&amp;quot;False&amp;quot; HeadersVisibility=&amp;quot;All&amp;quot; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ColumnHeaderHeight=&amp;quot;30&amp;quot; FontFamily=&amp;quot;Verdana&amp;quot; FontSize=&amp;quot;12&amp;quot; &amp;nbsp; &amp;nbsp;Background=&amp;quot;#FFFFFFFF&amp;quot; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; OpacityMask=&amp;quot;#FFF1E3E3&amp;quot; Foreground=&amp;quot;#FF000000&amp;quot; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BorderThickness=&amp;quot;1&amp;quot; SnapsToDevicePixels=&amp;quot;False&amp;quot; CanUserDeleteRows=&amp;quot;False&amp;quot; CanUserAddRows=&amp;quot;False&amp;quot; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ClipToBounds=&amp;quot;False&amp;quot; RowHeight=&amp;quot;25&amp;quot; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ScrollViewer.CanContentScroll=&amp;quot;True&amp;quot; Padding=&amp;quot;0&amp;quot; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; VerticalContentAlignment=&amp;quot;Center&amp;quot; MinWidth=&amp;quot;0&amp;quot; &amp;nbsp;HorizontalScrollBarVisibility=&amp;quot;Hidden&amp;quot; VerticalScrollBarVisibility=&amp;quot;Visible&amp;quot; GridLinesVisibility=&amp;quot;All&amp;quot; Name=&amp;quot;grdWorkOrders&amp;quot; Margin=&amp;quot;0,0,0,52&amp;quot; Height=&amp;quot;150&amp;quot; VerticalAlignment=&amp;quot;Top&amp;quot; EnableColumnVirtualization=&amp;quot;False&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;dg:DataGrid.Columns&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;dg:DataGridTemplateColumn &amp;nbsp;MinWidth=&amp;quot;30&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;dg:DataGridTemplateColumn.CellTemplate&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;DataTemplate&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;CheckBox x:Name=&amp;quot;chkMain&amp;quot;&amp;gt;&amp;lt;/CheckBox&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/DataTemplate&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/dg:DataGridTemplateColumn.CellTemplate&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/dg:DataGridTemplateColumn&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;!--&amp;lt;dg:DataGridCheckBoxColumn &amp;nbsp; &amp;nbsp;Header=&amp;quot;Access&amp;quot;&amp;gt;&amp;lt;/dg:DataGridCheckBoxColumn&amp;gt;--&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;dg:DataGridTextColumn Binding=&amp;quot;{Binding Path=ActivityName}&amp;quot; Header=&amp;quot;AIRCRAFT&amp;quot; &amp;nbsp; &amp;nbsp; &amp;nbsp; FontSize=&amp;quot;10&amp;quot; MinWidth=&amp;quot;110&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;dg:DataGridTextColumn Binding=&amp;quot;{Binding Path=Description}&amp;quot; Header=&amp;quot;FLEET&amp;quot; &amp;nbsp; FontSize=&amp;quot;10&amp;quot; MinWidth=&amp;quot;40&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;dg:DataGridTextColumn Binding=&amp;quot;{Binding Path=Description}&amp;quot; Header=&amp;quot;MAINTENANCE FLEET&amp;quot; &amp;nbsp; FontSize=&amp;quot;10&amp;quot; MinWidth=&amp;quot;40&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;dg:DataGridCheckBoxColumn &amp;nbsp;Header=&amp;quot;RESPONSABILITY&amp;quot;&amp;gt;&amp;lt;/dg:DataGridCheckBoxColumn&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/dg:DataGrid.Columns&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/dg:DataGrid&amp;gt;&lt;/p&gt;
&lt;p&gt;-----------Code Behind --------------------&lt;/p&gt;
&lt;p&gt;for (int nCntr = 0; nCntr &amp;lt; grdWorkOrders.Items.Count; nCntr++)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var cntr = MyDataGrid.ItemContainerGenerator.ContainerFromIndex(nCntr);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DataGridRow ObjROw = (DataGridRow)cntr;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (ObjROw == null)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ObjROw = (DataGridRow)MyDataGrid.ItemContainerGenerator.ContainerFromIndex(nCntr);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;else&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FrameworkElement objElement = MyDataGrid.Columns[0].GetCellContent(ObjROw);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (objElement != null)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (objElement.GetType().ToString().EndsWith(&amp;quot;CheckBox&amp;quot;))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CheckBox objChk = (CheckBox)objElement;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;objChk.IsChecked = true;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;} &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9525412" width="1" height="1"&gt;</description></item><item><title>re: WPF DataGrid: Dissecting the Visual Layout</title><link>http://blogs.msdn.com/b/vinsibal/archive/2008/08/14/wpf-datagrid-dissecting-the-visual-layout.aspx#9478985</link><pubDate>Sun, 15 Mar 2009 16:55:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9478985</guid><dc:creator>Vincent Sibal - MSFT</dc:creator><description>&lt;p&gt;Brian,&lt;/p&gt;
&lt;p&gt;If your DataGridTemplateColumn does not requre a very flexible DataTemplate that dynamically changes all the time, you can consider using a solution similar to what I did in the sample on this post, &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/vinsibal/archive/2008/10/22/wpf-datagrid-and-the-wpftoolkit-have-released.aspx"&gt;http://blogs.msdn.com/vinsibal/archive/2008/10/22/wpf-datagrid-and-the-wpftoolkit-have-released.aspx&lt;/a&gt;. &amp;nbsp;Take a look at the DataGridCustomTemplateColumn class. &amp;nbsp;In that class I added a Binding DependencyProperty so you can set the binding directly on the column. &amp;nbsp;In the GenerateElement and GenerateEditingElement you can see I walk the visual tree and find the inner control that I want to set the binding to. &amp;nbsp;Hope that can give you some ideas.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9478985" width="1" height="1"&gt;</description></item></channel></rss>