<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: WPF DataGrid &#8211; Committing changes cell-by-cell</title>
	<atom:link href="http://www.scottlogic.co.uk/blog/colin/2009/01/wpf-datagrid-committing-changes-cell-by-cell/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.scottlogic.co.uk/blog/colin/2009/01/wpf-datagrid-committing-changes-cell-by-cell/</link>
	<description>Colin Eberhardt&#039;s Adventures in .NET</description>
	<lastBuildDate>Thu, 09 Feb 2012 03:02:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Jay R. Wren</title>
		<link>http://www.scottlogic.co.uk/blog/colin/2009/01/wpf-datagrid-committing-changes-cell-by-cell/#comment-61624</link>
		<dc:creator>Jay R. Wren</dc:creator>
		<pubDate>Tue, 28 Jun 2011 17:39:26 +0000</pubDate>
		<guid isPermaLink="false">http://wpfadventures.wordpress.com/?p=38#comment-61624</guid>
		<description>I found this a little bit better:

private IEditableObject rowBeingEdited = null;
private void dataGrid_CellEditEnding(object sender,
                                  DataGridCellEditEndingEventArgs e)
{
    DataRowView rowView = e.Row.Item as IEditableObject;
    rowBeingEdited = rowView;
}
 
private void dataGrid_CurrentCellChanged(object sender, EventArgs e)
{
    if (rowBeingEdited != null &amp;&amp; dataGrid.CurrentCell.Item != rowBeingEdited)
    {
        rowBeingEdited.EndEdit();
    }
}

This also addresses Michael&#039;s concern about not deriving from DataRowView.</description>
		<content:encoded><![CDATA[<p>I found this a little bit better:</p>
<p>private IEditableObject rowBeingEdited = null;<br />
private void dataGrid_CellEditEnding(object sender,<br />
                                  DataGridCellEditEndingEventArgs e)<br />
{<br />
    DataRowView rowView = e.Row.Item as IEditableObject;<br />
    rowBeingEdited = rowView;<br />
}</p>
<p>private void dataGrid_CurrentCellChanged(object sender, EventArgs e)<br />
{<br />
    if (rowBeingEdited != null &amp;&amp; dataGrid.CurrentCell.Item != rowBeingEdited)<br />
    {<br />
        rowBeingEdited.EndEdit();<br />
    }<br />
}</p>
<p>This also addresses Michael&#8217;s concern about not deriving from DataRowView.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy</title>
		<link>http://www.scottlogic.co.uk/blog/colin/2009/01/wpf-datagrid-committing-changes-cell-by-cell/#comment-59740</link>
		<dc:creator>Jeremy</dc:creator>
		<pubDate>Fri, 17 Jun 2011 00:32:04 +0000</pubDate>
		<guid isPermaLink="false">http://wpfadventures.wordpress.com/?p=38#comment-59740</guid>
		<description>Now if invoking EndEdit() would cause my DataColumn expression to re-evaluate.  :(</description>
		<content:encoded><![CDATA[<p>Now if invoking EndEdit() would cause my DataColumn expression to re-evaluate.  <img src='http://www.scottlogic.co.uk/blog/colin/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colin Eberhardt</title>
		<link>http://www.scottlogic.co.uk/blog/colin/2009/01/wpf-datagrid-committing-changes-cell-by-cell/#comment-11444</link>
		<dc:creator>Colin Eberhardt</dc:creator>
		<pubDate>Mon, 24 May 2010 07:25:45 +0000</pubDate>
		<guid isPermaLink="false">http://wpfadventures.wordpress.com/?p=38#comment-11444</guid>
		<description>@gauss, nice one. Thanks for the link.</description>
		<content:encoded><![CDATA[<p>@gauss, nice one. Thanks for the link.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gauss</title>
		<link>http://www.scottlogic.co.uk/blog/colin/2009/01/wpf-datagrid-committing-changes-cell-by-cell/#comment-11307</link>
		<dc:creator>gauss</dc:creator>
		<pubDate>Thu, 20 May 2010 10:10:59 +0000</pubDate>
		<guid isPermaLink="false">http://wpfadventures.wordpress.com/?p=38#comment-11307</guid>
		<description>In the WPF Datagrid that was released with .net4.0 there is an easy way to commit the complete row on every cell edit regardless of what data is bound to it. Check out the code here: http://codefluff.blogspot.com/2010/05/commiting-bound-cell-changes.html</description>
		<content:encoded><![CDATA[<p>In the WPF Datagrid that was released with .net4.0 there is an easy way to commit the complete row on every cell edit regardless of what data is bound to it. Check out the code here: <a href="http://codefluff.blogspot.com/2010/05/commiting-bound-cell-changes.html" rel="nofollow">http://codefluff.blogspot.com/2010/05/commiting-bound-cell-changes.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colin Eberhardt</title>
		<link>http://www.scottlogic.co.uk/blog/colin/2009/01/wpf-datagrid-committing-changes-cell-by-cell/#comment-10870</link>
		<dc:creator>Colin Eberhardt</dc:creator>
		<pubDate>Sat, 08 May 2010 06:08:41 +0000</pubDate>
		<guid isPermaLink="false">http://wpfadventures.wordpress.com/?p=38#comment-10870</guid>
		<description>@rgames, you  can find an answer to navigato&#039;s question here:

http://social.msdn.microsoft.com/Forums/en/wpf/thread/c9a80fe6-cfca-4f5f-81d0-76c1ea3afa51

Basically, if you are not binding to a DataTable, you need to cast to your own type.</description>
		<content:encoded><![CDATA[<p>@rgames, you  can find an answer to navigato&#8217;s question here:</p>
<p><a href="http://social.msdn.microsoft.com/Forums/en/wpf/thread/c9a80fe6-cfca-4f5f-81d0-76c1ea3afa51" rel="nofollow">http://social.msdn.microsoft.com/Forums/en/wpf/thread/c9a80fe6-cfca-4f5f-81d0-76c1ea3afa51</a></p>
<p>Basically, if you are not binding to a DataTable, you need to cast to your own type.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rgames</title>
		<link>http://www.scottlogic.co.uk/blog/colin/2009/01/wpf-datagrid-committing-changes-cell-by-cell/#comment-10829</link>
		<dc:creator>rgames</dc:creator>
		<pubDate>Fri, 07 May 2010 04:35:56 +0000</pubDate>
		<guid isPermaLink="false">http://wpfadventures.wordpress.com/?p=38#comment-10829</guid>
		<description>Same problem as navigato.  Any help on that?</description>
		<content:encoded><![CDATA[<p>Same problem as navigato.  Any help on that?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: navigato</title>
		<link>http://www.scottlogic.co.uk/blog/colin/2009/01/wpf-datagrid-committing-changes-cell-by-cell/#comment-7818</link>
		<dc:creator>navigato</dc:creator>
		<pubDate>Mon, 25 Jan 2010 16:37:03 +0000</pubDate>
		<guid isPermaLink="false">http://wpfadventures.wordpress.com/?p=38#comment-7818</guid>
		<description>Hi Colin,

my &quot;rowdata&quot; is not derived from DataRowView Class and for that reason I always get &quot;null&quot; for rowView out of 
DataRowView rowView = e.Row.Item as DataRowView;
And I&#039;m not the only one with this problem as you can see here:
http://social.msdn.microsoft.com/Forums/en/wpf/thread/c9a80fe6-cfca-4f5f-81d0-76c1ea3afa51
Do you think there is a possibility to get a solution as simple as your one for the problem? Would be great to get an answer.

Michael</description>
		<content:encoded><![CDATA[<p>Hi Colin,</p>
<p>my &#8220;rowdata&#8221; is not derived from DataRowView Class and for that reason I always get &#8220;null&#8221; for rowView out of<br />
DataRowView rowView = e.Row.Item as DataRowView;<br />
And I&#8217;m not the only one with this problem as you can see here:<br />
<a href="http://social.msdn.microsoft.com/Forums/en/wpf/thread/c9a80fe6-cfca-4f5f-81d0-76c1ea3afa51" rel="nofollow">http://social.msdn.microsoft.com/Forums/en/wpf/thread/c9a80fe6-cfca-4f5f-81d0-76c1ea3afa51</a><br />
Do you think there is a possibility to get a solution as simple as your one for the problem? Would be great to get an answer.</p>
<p>Michael</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colin Eberhardt</title>
		<link>http://www.scottlogic.co.uk/blog/colin/2009/01/wpf-datagrid-committing-changes-cell-by-cell/#comment-6615</link>
		<dc:creator>Colin Eberhardt</dc:creator>
		<pubDate>Wed, 16 Dec 2009 13:47:05 +0000</pubDate>
		<guid isPermaLink="false">http://wpfadventures.wordpress.com/?p=38#comment-6615</guid>
		<description>Glad to hear that it helped you :-)

Colin E.</description>
		<content:encoded><![CDATA[<p>Glad to hear that it helped you <img src='http://www.scottlogic.co.uk/blog/colin/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Colin E.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

