Note that there are some explanatory texts on larger screens.

plurals
  1. POWPF datagrid Refresh when changes occurs at cell level
    primarykey
    data
    text
    <p>I have a Datagrid binded to an ObservabelCollection. The datagrid refresh very well when the changes are Add, remove ítems on the collection, but if i change a property of one Ítem on that collection, the grid doesn't refresh. </p> <p>Grid definition:</p> <pre><code> &lt;DataGrid x:Name="DatGridPlanillas" ItemsSource="{Binding ListaPlanillas,Mode=TwoWay}"&gt; &lt;DataGrid.Columns&gt; &lt;DataGridTextColumn Header="{x:Static resources:Labels.GENERAL_IdDocumeto}" Binding="{Binding StrIdDocumento,Mode=TwoWay}" ClipboardContentBinding="{x:Null}"/&gt; &lt;DataGridTextColumn Header="{x:Static resources:Labels.GENERAL_FechaCreacion}" Binding="{Binding DatFechaDocumento}" ClipboardContentBinding="{x:Null}"/&gt; &lt;/DataGrid.Columns&gt; &lt;/DataGrid&gt; </code></pre> <p>Changes </p> <pre><code>DocumentsBO MiGestorDeDocumentos = new DocumentsBO(db); foreach (MyEntity Doc in ListaPlanillas) { Documento DocumentoFinal = MiGestorDeDocumentos.NewDocIdByModule(_IntIdModulo); Doc.StrIdDocumento = DocumentoFinal.StrIdDocumento; Doc.IntIdDocumento = DocumentoFinal.IntIdDocumento; Doc.PlanillaAcopioGenerada = true; Doc.NumDocumentonumero = DocumentoFinal.NumDocumento; db.entry(Doc).State = EntityState.Modified; } </code></pre> <p>The only way I found is to empty original Collection and then restore it</p> <pre><code>db.SaveChanges(); ObservableCollection&lt;MyEntity&gt; _tmp = _ListaPlanillas; ListaPlanillas = new ObservableCollection&lt;MyEntity&gt;(); ListaPlanillas = _tmp; </code></pre> <p>But this sounds to me very ugly way to perform something so simple. How can i do to force the grid to update when just a property of collection was changed? </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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