public static SfDataGrid DefaultDataGridTemplate(DataTable dataTable, int sheetIndex, MainWindow window,
                                                         string prefab)
        {
            SfDataGrid dataGrid = new SfDataGridExt
            {
                ItemsSource             = dataTable,
                AllowDraggingColumns    = true,
                AllowDraggingRows       = true,
                AllowDeleting           = true,
                AllowGrouping           = true,
                ShowRowHeader           = true,
                AllowFrozenGroupHeaders = true,
                AllowFiltering          = true,
                AllowTriStateSorting    = true,
                ShowSortNumbers         = true,
                AllowResizingColumns    = true,
                AllowEditing            = true,
                NavigationMode          = NavigationMode.Cell,
                AutoGenerateColumns     = false,
                SelectionUnit           = GridSelectionUnit.Any,
                SelectionMode           = GridSelectionMode.Extended,
                GridValidationMode      = GridValidationMode.InView,
                IsEnabled            = true,
                HeaderRowHeight      = 30,
                ShowGroupDropArea    = true,
                ColumnSizer          = GridLengthUnitType.Auto,
                IsDynamicItemsSource = true,
                LiveDataUpdateMode   = LiveDataUpdateMode.AllowDataShaping,
                UsePLINQ             = true,
                AddNewRowPosition    = AddNewRowPosition.FixedTop
            };

            //dataGrid.SearchHelper = new SearchHelperExt(dataGrid);

            /*dataGrid.SortColumnDescriptions.CollectionChanged += (sender, args) =>
             * {
             *      window.ResetSorts.IsChecked = false;
             * };
             * dataGrid.GroupColumnDescriptions.CollectionChanged += (sender, args) =>
             * {
             *      window.ResetGroupsBox.IsChecked = false;
             * };*/
            //dataGrid.RecordDeleted += (sender, args) => { window.RevertChanges.IsEnabled = true; };

            var j = 0;

            dataGrid.Loaded += (sender, args) =>
            {
                if (j == 0)
                {
                    GenerateColumnsSfDataGrid(dataGrid, dataTable, prefab);

                    ResetGridSorting(dataGrid, prefab, true);
                }

                j++;
            };
            return(dataGrid);
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 9 "..\..\ComboBoxBuilder.xaml"
                ((NSDMasterInventorySF.ComboBoxBuilder)(target)).Loaded += new System.Windows.RoutedEventHandler(this.OnLoaded);

            #line default
            #line hidden

            #line 9 "..\..\ComboBoxBuilder.xaml"
                ((NSDMasterInventorySF.ComboBoxBuilder)(target)).Closed += new System.EventHandler(this.ComboBoxBuilder_OnClosed);

            #line default
            #line hidden
                return;

            case 2:
                this.AddColumnButton = ((System.Windows.Controls.Button)(target));

            #line 37 "..\..\ComboBoxBuilder.xaml"
                this.AddColumnButton.Click += new System.Windows.RoutedEventHandler(this.AddColumnButton_OnClick);

            #line default
            #line hidden
                return;

            case 3:
                this.SaveButton = ((System.Windows.Controls.Button)(target));

            #line 38 "..\..\ComboBoxBuilder.xaml"
                this.SaveButton.Click += new System.Windows.RoutedEventHandler(this.SaveButton_OnClick);

            #line default
            #line hidden
                return;

            case 4:
                this.ComboGrid = ((NSDMasterInventorySF.ui.SfDataGridExt)(target));
                return;
            }
            this._contentLoaded = true;
        }
예제 #3
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 9 "..\..\PrefabBuilder.xaml"
                ((NSDMasterInventorySF.PrefabBuilder)(target)).Loaded += new System.Windows.RoutedEventHandler(this.OnLoaded);

            #line default
            #line hidden

            #line 9 "..\..\PrefabBuilder.xaml"
                ((NSDMasterInventorySF.PrefabBuilder)(target)).Closed += new System.EventHandler(this.PrefabBuilder_OnClosed);

            #line default
            #line hidden
                return;

            case 2:
                this.SaveButton = ((System.Windows.Controls.Button)(target));

            #line 39 "..\..\PrefabBuilder.xaml"
                this.SaveButton.Click += new System.Windows.RoutedEventHandler(this.SavePrefab);

            #line default
            #line hidden
                return;

            case 3:
                this.EditComboBoxes = ((System.Windows.Controls.Button)(target));

            #line 41 "..\..\PrefabBuilder.xaml"
                this.EditComboBoxes.Click += new System.Windows.RoutedEventHandler(this.EditComboBoxes_OnClick);

            #line default
            #line hidden
                return;

            case 4:
                this.ItemNameField = ((Syncfusion.Windows.Controls.Input.SfTextBoxExt)(target));

            #line 43 "..\..\PrefabBuilder.xaml"
                this.ItemNameField.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.ItemNameField_OnTextChanged);

            #line default
            #line hidden
                return;

            case 5:
                this.RowPositionTextBox = ((Syncfusion.Windows.Shared.IntegerTextBox)(target));

            #line 49 "..\..\PrefabBuilder.xaml"
                this.RowPositionTextBox.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.RowPositionTextBox_OnValueChanged);

            #line default
            #line hidden
                return;

            case 6:
                this.AddNewRowButton = ((System.Windows.Controls.Button)(target));

            #line 52 "..\..\PrefabBuilder.xaml"
                this.AddNewRowButton.Click += new System.Windows.RoutedEventHandler(this.AddNewRowButton_OnClick);

            #line default
            #line hidden
                return;

            case 7:
                this.PrefabGrid = ((NSDMasterInventorySF.ui.SfDataGridExt)(target));
                return;
            }
            this._contentLoaded = true;
        }