Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm assuming your datagrid is bound to an IEnumerable, maybe a List&lt;>? Have you tried using an ObservableCollection&lt;>? If you are bound to an ObservableCollection, it will let the UI know when the collection has changed.</p> <pre><code>&lt;UserControl x:Class="SilverlightApplication1.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:SilverlightApplication1" xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"&gt; &lt;UserControl.DataContext&gt; &lt;local:MainPage_ViewModel/&gt; &lt;/UserControl.DataContext&gt; &lt;StackPanel&gt; &lt;data:DataGrid ItemsSource="{Binding MyCollection}"&gt; &lt;/data:DataGrid&gt; &lt;/StackPanel&gt; </code></pre> <p></p> <pre><code>public class MainPage_ViewModel : INotifyPropertyChanged { public ObservableCollection&lt;object&gt; MyCollection { get { return myCollection; } set { if (myCollection != value) { myCollection = value; OnPropertyChanged("MyCollection"); } } } private ObservableCollection&lt;object&gt; myCollection = new ObservableCollection&lt;object&gt;(); public void LoadData() { //execute load method, the assign result to MyCollection } #region INotifyPropertyChanged Members public event PropertyChangedEventHandler PropertyChanged; public void OnPropertyChanged(string propertyName) { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } #endregion } </code></pre>
    singulars
    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.
    1. This table or related slice is empty.
    1. VO
      singulars
      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