Exemplo n.º 1
0
        private void UndoChanges_Click(object sender, RoutedEventArgs e)
        {
            DataView dt = (DataView)dataGrid.ItemsSource;

            WorkWithCommonConfFixer.GetValuesFromGrid(dt.Table);
            this.Close();
        }
Exemplo n.º 2
0
        private void MakeChangesToGrid(object sender, MouseButtonEventArgs e)
        {
            DataView dt = (DataView)dataGrid.ItemsSource;

            if (WorkWithCommonConfFixer.CompareVersion(dv, dt.Table))
            {
                dataGrid.ItemsSource = dv;
            }

            System.Diagnostics.Debug.WriteLine("I'm awesome guy");
        }
Exemplo n.º 3
0
        private void FillGrid()
        {
            EditProp.configChanged  = false;
            EditProp.configIterator = 0;
            DataGridCheckBoxColumn checkVersion;
            DataGridComboBoxColumn cmbBoxCol;
            DataGridTextColumn     textColumn;

            string[] colNames = new string[] { "Конфигурация", "Обозначение", "Наименование", "Масса" };
            foreach (var item in colNames)
            {
                textColumn         = new DataGridTextColumn();
                textColumn.Header  = item;
                textColumn.Binding = new Binding(item);
                if (item == "Конфигурация")
                {
                    textColumn.IsReadOnly = true;
                }

                dataGrid.Columns.Add(textColumn);
            }

            // COMBOBOX
            cmbBoxCol                     = new DataGridComboBoxColumn();
            cmbBoxCol.Header              = "Раздел";
            cmbBoxCol.ItemsSource         = EditProp.razdel;
            cmbBoxCol.SelectedItemBinding = new Binding("Раздел");
            dataGrid.Columns.Add(cmbBoxCol);


            //CHECHBOX
            checkVersion         = new DataGridCheckBoxColumn();
            checkVersion.Header  = "Исполнение";
            checkVersion.Binding = new Binding("Исполнение");
            dataGrid.Columns.Add(checkVersion);


            /*delegatik = new My(MakeChangesToGrid);
             *
             * EventSetter setter = new EventSetter();
             *
             * setter.Event = TapEvent;
             *
             * setter.Handler = delegatik;
             * Style style = checkVersion.CellStyle;
             * style.Setters.Add(setter);
             */


            dv = WorkWithCommonConfFixer.PropertiesForEachConf().AsDataView();
            dataGrid.ItemsSource = dv;
        }