Note that there are some explanatory texts on larger screens.

plurals
  1. POSilverlight: Problem using CellEditingTemplate
    text
    copied!<p>I am experiencing a problem with the DataGrid where my data-bound object's properties are not being updated when using the CellTemplate/CellEditingTemplate:</p> <pre><code>&lt;data:DataGridTemplateColumn Header="Text"&gt; &lt;data:DataGridTemplateColumn.CellTemplate&gt; &lt;DataTemplate&gt; &lt;TextBlock Text="{Binding Text}" &gt;&lt;/TextBlock&gt; &lt;/DataTemplate&gt; &lt;/data:DataGridTemplateColumn.CellTemplate&gt; &lt;data:DataGridTemplateColumn.CellEditingTemplate&gt; &lt;DataTemplate&gt; &lt;TextBox Text="{Binding Text, Mode=TwoWay}" /&gt; &lt;/DataTemplate&gt; &lt;/data:DataGridTemplateColumn.CellEditingTemplate&gt; &lt;/data:DataGridTemplateColumn&gt; </code></pre> <p>I am binding to a code-gen'd entity via the RIA Services. I've added an event handler to the PropertyChanged event, and it is never fired. However, if I do not use a template and instead use a DataGridTextColumn, everything works fine.</p> <p>I'm sure this sounds like an easy fix - I'm only using a TextBox in my editing template, so why not us a DataGridTextColumn? The problem is that I want to have a multi-line textbox, so using the DataGridTextColumn is not an option.</p> <p>Any suggestions? Do you know of any differences between using a CellEditingTemplate containing a single TextBox and using a DataGridTextColumn?</p> <p>Thanks,<br> -Charles</p> <p><strong>[UPDATE]</strong><br> I posted a bug report here:<br> <a href="http://silverlight.net/forums/p/118729/267521.aspx" rel="nofollow noreferrer">http://silverlight.net/forums/p/118729/267521.aspx</a></p> <p>I can't imagine that this is "as-designed"... If someone else has known about this and I'm just being dumb, I'd appreciate an explanation - I'd prefer embarrassment over ignorance :).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload