예제 #1
0
        private void RemoveItem(bool force = false)
        {
            int index = MyDataGridView.Items.IndexOf(MyDataGridView.SelectedItem);

            Invoices_Items[] _items = new Invoices_Items[MyDataGridView.Items.Count];
            MyDataGridView.Items.CopyTo(_items, 0);
            foreach (Invoices_Items item in _items)
            {
                if (!force && MyDataGridView.Items.IndexOf(item) == index)
                {
                    continue;
                }

                if (item.Id <= 0 && item.IsNewInvoiceItem)
                {
                    context.Invoices_Items.Remove(item);
                    MyDataGridView.UpdateLayout();
                }
            }
        }
예제 #2
0
 private void QtyPriceTBox_TextChanged(object sender, TextChangedEventArgs e)
 {
     SetTotals(true, false);
     MyDataGridView.UpdateLayout();
 }