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

            if (row != null)
            {
                try
                {
                    list.RemoveAt(findInList(row.id));
                    dataGridMaterialExport.Items.Refresh();
                }
                catch (Exception) { }
            }
        }
            public override ValidationResult Validate(object value,
                                                      System.Globalization.CultureInfo cultureInfo)
            {
                InventoryExportDetailObject course = (value as BindingGroup).Items[0] as InventoryExportDetailObject;
                int s;

                if (Int32.TryParse(course.amount, out s) && s < 2)
                {
                    return(new ValidationResult(false,
                                                "Start Date must be earlier than End Date."));
                }
                else
                {
                    return(ValidationResult.ValidResult);
                }
            }