<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://xceed.com/CS/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>Xceed DataGrid for WPF</title><link>http://xceed.com/CS/forums/35/ShowForum.aspx</link><description>Community support section for Xceed DataGrid for WPF, Xceed 3D Views for WPF, Xceed Editors for WPF, and Xceed Professional Themes for WPF</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Debug Build: 61120.2)</generator><item><title>Re: How can I get the Item from its DataRow?</title><link>http://xceed.com/CS/forums/thread/31898.aspx</link><pubDate>Sat, 24 Mar 2012 22:53:00 GMT</pubDate><guid isPermaLink="false">14592c03-f9d0-4f6b-b4cd-71e0e1b1f679:31898</guid><dc:creator>Insight</dc:creator><slash:comments>0</slash:comments><comments>http://xceed.com/CS/forums/thread/31898.aspx</comments><wfw:commentRss>http://xceed.com/CS/forums/commentrss.aspx?SectionID=35&amp;PostID=31898</wfw:commentRss><description>&lt;P&gt;I found a solution - but so your developers know, I think there is a bug with GetItemFromContainer() when insertion rows are involved.&lt;/P&gt;
&lt;P&gt;The solution is to instead use ((Row) sender).DataContext&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;When the Row is a normal DataRow, this will give the &lt;SPAN style="COLOR:#2b91af;"&gt;MyObject &lt;FONT color=#000000&gt;underlyingItem&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;correctly.&lt;/LI&gt;
&lt;LI&gt;When the Row is an InsertionRow, and the InsertionRow is not currently being edited, this will give a DataTemplate object.&lt;/LI&gt;
&lt;LI&gt;When the Row is an InsertionRow, and the InsertionRow IS currently being edited, this will correctly give the &lt;SPAN style="COLOR:#2b91af;"&gt;MyObject &lt;FONT color=#000000&gt;underlyingItem&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;that has been created but not yet comitted.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Note that whether an InsertionRow is currently being edited or not (i.e. whether or not the InsertionRow currently has an underlying item), GetItemFromContainer() will always return the DataTemplate of the InsertionRow, and I think that's a mistake.&lt;/P&gt;</description></item><item><title>How can I get the Item from its DataRow?</title><link>http://xceed.com/CS/forums/thread/31885.aspx</link><pubDate>Fri, 23 Mar 2012 17:43:21 GMT</pubDate><guid isPermaLink="false">14592c03-f9d0-4f6b-b4cd-71e0e1b1f679:31885</guid><dc:creator>Insight</dc:creator><slash:comments>0</slash:comments><comments>http://xceed.com/CS/forums/thread/31885.aspx</comments><wfw:commentRss>http://xceed.com/CS/forums/commentrss.aspx?SectionID=35&amp;PostID=31885</wfw:commentRss><description>&lt;P&gt;Usually I can just go&lt;/P&gt;&lt;PRE style="FONT-FAMILY:Courier New;BACKGROUND:white;COLOR:black;FONT-SIZE:13px;"&gt;&lt;SPAN style="COLOR:#2b91af;"&gt;MyObject&lt;/SPAN&gt;&amp;nbsp;underlyingItem&amp;nbsp;=&amp;nbsp;myDataGrid.GetItemFromContainer((DataRow) sender);&lt;/PRE&gt;
&lt;P&gt;But when sender is an insertionRow, GetItemFromContainer doesn't return the insertion row's underlying item, it returns a DataTemplate object. What gives?&lt;/P&gt;</description></item></channel></rss>