title: Delete Item GridView Windows 8 Metro
body: <p>I an trying to delete items from a GridView control. When I click delete, the GridView fails to update </p>
  
  <p>I have bound a GridView with a list of orders in an observable collection. Here is my order class:</p>
  
  <pre><code>public class Order : INotifyPropertyChanged
  {
      public Order() { }
      private int _id;
      [PrimaryKey, AutoIncrement]
      public int Id
      {
          get { return _id; }
          set
          {
  
              this._id = value;
              Notify("ID");
          }
      }
      public int RestaurantID { get; set;}
      public DateTime Date { get; set; }
      public string Note { get; set; }
      public decimal TotalPrice { get; set; }
      [Ignore]
      public List&lt;OrderDetail&gt; OrderDetails { get; set; }
  
      #region INotifyPropertyChanged Members
  
      [Ignore]
      public event PropertyChangedEventHandler PropertyChanged;
  
      [Ignore]
      protected void Notify(string propName)
      {
          if (this.PropertyChanged != null)
          {
              PropertyChanged(this, new PropertyChangedEventArgs(propName));
          }
      }
      #endregion
  }
  </code></pre>
  
  <p>Here is my data binding code:</p>
  
  <pre><code> ObservableCollection&lt;Order&gt; orderCollection = new ObservableCollection&lt;Order&gt;();
              foreach (Order ord in orders)
              {
                  orderCollection.Add(ord);
              }
  
              this.DefaultViewModel["Items"] = orderCollection;
  </code></pre>
  
  <p>My delete button exists in the GridView's DataTemplate. Here is my delete code:</p>
  
  <pre><code>    private void btnDelete_Click_1(object sender, RoutedEventArgs e)
      {
          Button btnDelete = (Button)sender;
          Order order = btnDelete.DataContext as Order;
          repository.DeleteOrder(order.Id);
      }
  </code></pre>