private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            InventoryImportDetailObject row = (InventoryImportDetailObject)dataGridMaterialImport.SelectedItem;

            if (row != null)
            {
                try
                {
                    list.RemoveAt(findInList(row.id));
                    dataGridMaterialImport.Items.Refresh();
                }
                catch (Exception) { }
            }
        }
Example #2
0
        private void tbPrice_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            InventoryImportDetailObject row = (InventoryImportDetailObject)dataGridMaterialImport.SelectedItem;

            //MessageBox.Show(row.unit);
            if (mapNameIsUse[row.name] != "1" || mapNameUnit[row.name] != row.unit)
            {
                MessageBox.Show("Thông tin về vật liệu này đã được chỉnh sửa, bạn không thể thay đổi ");
                TextBox tb1 = (TextBox)sender; tb1.IsEnabled = false;
                tb1.IsReadOnly         = true;
                tb1.MouseLeftButtonUp -= tbPrice_MouseLeftButtonUp;
                return;
            }
            TextBox tb = (TextBox)sender;

            tb.GotFocus += tbPrice_GotFocus;
        }