//private void OnFocusedColumnChanged(object sender, DevExpress.Xpf.Grid.FocusedColumnChangedEventArgs e)
        //{
        //    var foo = (TableView)sender;
        //    var bar = (TableView)e.Source;
        //    var column = (GridColumn)e.NewColumn;
        //    System.Diagnostics.Debug.WriteLine("OnFocusedColumnChanged: {0} - {1}", column.Name, column.FieldName);

        //}

        //private void OnColumnHeaderClick(object sender, DevExpress.Xpf.Grid.ColumnHeaderClickEventArgs e)
        //{
        //    var foo = (TableView)sender;
        //    var bar = (TableView)e.Source;
        //    var column = e.Column;
        //    System.Diagnostics.Debug.WriteLine("OnColumnHeaderClick: {0} - {1}", column.Name, column.FieldName);
        //}

        private void OnShowGridMenu(object sender, DevExpress.Xpf.Grid.GridMenuEventArgs e)
        {
            var foo  = (TableView)sender;
            var bar  = (TableView)e.Source;
            var mnui = (GridColumnMenuInfo)e.MenuInfo;
            var mnut = e.MenuType;

            if (mnut == GridMenuType.Column)
            {
                currentColumn = mnui.Column;

                GridColumn column = mnui.Column;
                System.Diagnostics.Debug.WriteLine("OnShowGridMenu: {0} - {1}", column.Name, column.FieldName);

                switch (currentColumn.FieldName)
                {
                case "ExpandContent":
                case "ExpandJobServer":
                case "ExpandLinkedServers":
                case "ExpandLogins":
                case "ExpandServerRoles":
                case "ExpandStorage":
                case "ExpandTriggers":
                    bi_CheckAll.IsVisible   = true;
                    bi_UnCheckAll.IsVisible = true;
                    break;

                default:
                    bi_CheckAll.IsVisible   = false;
                    bi_UnCheckAll.IsVisible = false;
                    break;
                }
            }
        }
Пример #2
0
        private void TableView_ShowGridMenu(object sender, DevExpress.Xpf.Grid.GridMenuEventArgs e)
        {
            // Check whether this event was raised for a column's context menu.
            if (e.MenuType != GridMenuType.Column)
            {
                return;
            }

            // Remove the Column Chooser menu item.
            e.Customizations.Add(new RemoveBarItemAndLinkAction()
            {
                ItemName = DefaultColumnMenuItemNames.ColumnChooser
            });

            // Create a custom menu item and add it to the context menu.
            BarButtonItem bi = new BarButtonItem();

            bi.Name       = "customItem";
            bi.Content    = "Custom Item";
            bi.ItemClick += new ItemClickEventHandler(customItem_ItemClick);
            e.Customizations.Add(bi);
        }
Пример #3
0
        private void tableview0_ShowGridMenu(object sender, DevExpress.Xpf.Grid.GridMenuEventArgs e)
        {
            // 특정 컬럼 컨텍스트 메뉴 팝업
            if (e.MenuInfo.Column.VisibleIndex == 4)
            {
                e.MenuInfo.Column.AllowEditing = DevExpress.Utils.DefaultBoolean.False;
                BarButtonItem item0 = new BarButtonItem {
                    Content = "일괄 선택"
                };
                item0.ItemClick += (s, ex) => { MessageBox.Show("clicked!!"); };
                BarItemLinkActionBase.SetItemLinkIndex(item0, 0);
                e.Customizations.Add(item0);

                BarItemLinkSeparator item2 = new BarItemLinkSeparator();
                BarItemLinkActionBase.SetItemLinkIndex(item2, 1);
                e.Customizations.Add(item2);

                BarCheckItem item1 = new BarCheckItem {
                    Content = "Checked", IsChecked = true
                };
                BarItemLinkActionBase.SetItemLinkIndex(item1, 2);
                e.Customizations.Add(item1);
            }
        }
Пример #4
0
        private void TableView_ShowGridMenu(object sender, DevExpress.Xpf.Grid.GridMenuEventArgs e)
        {
            switch (e.MenuType)
            {
            case GridMenuType.Column:
                if (columnMenuRemoveItemCheck.IsChecked.Value)
                {
                    e.Customizations.Add(new RemoveBarItemAndLinkAction()
                    {
                        ItemName = DefaultColumnMenuItemNames.GroupBox
                    });
                }
                if (!columnMenuAddItemCheck.IsChecked.Value)
                {
                    e.Customizations.Add(new RemoveBarItemAndLinkAction()
                    {
                        ItemName = "allowSortingItem"
                    });
                    e.Customizations.Add(new RemoveBarItemAndLinkAction()
                    {
                        ItemName = "allowGroupingItem"
                    });
                }
                break;

            case GridMenuType.GroupPanel:
                if (groupPanelMenuRemoveItemCheck.IsChecked.Value)
                {
                    e.Customizations.Add(new RemoveBarItemAndLinkAction()
                    {
                        ItemName = DefaultColumnMenuItemNames.ClearGrouping
                    });
                }
                if (!groupPanelMenuAddItemCheck.IsChecked.Value)
                {
                    e.Customizations.Add(new RemoveBarItemAndLinkAction()
                    {
                        ItemName = "allowAllSortingItem"
                    });
                    e.Customizations.Add(new RemoveBarItemAndLinkAction()
                    {
                        ItemName = "allowAllGroupingItem"
                    });
                }
                break;

            case GridMenuType.TotalSummary:
                if (totalMenuRemoveItemCheck.IsChecked.Value)
                {
                    e.Customizations.Add(new RemoveBarItemAndLinkAction()
                    {
                        ItemName = DefaultSummaryMenuItemNames.Customize
                    });
                }
                if (!object.ReferenceEquals(e.MenuInfo.Column, colUnitPrice))
                {
                    e.Customizations.Add(new RemoveBarItemAndLinkAction()
                    {
                        ItemName = "customSummaryMenuItem"
                    });
                }

                break;
            }
            CellMenuInfo = e.MenuType == GridMenuType.RowCell ? (GridCellMenuInfo)e.MenuInfo : null;
        }
Пример #5
0
 private void OnShowGridMenu(object sender, DevExpress.Xpf.Grid.GridMenuEventArgs e)
 {
     customizeContextMenuForSelection();
 }
Пример #6
0
        private void tableView_ShowGridMenu(object sender, DevExpress.Xpf.Grid.GridMenuEventArgs e)
        {
            GridCellMenuInfo menuInfo = tableView.GridMenu.MenuInfo as GridCellMenuInfo;

            if (menuInfo != null && menuInfo.Row != null && menuInfo.Column != null)
            {
                if (menuInfo.Row.ControllerVisibleIndex == GridControl.NewItemRowHandle)
                {
                    contextMenuDuplicate.IsEnabled      = false;
                    contextMenuDuplicateMulti.IsEnabled = false;
                }
                else
                {
                    contextMenuDuplicate.IsEnabled      = true;
                    contextMenuDuplicateMulti.IsEnabled = true;
                }

                if (menuInfo.Column == colWORKPACKInternalName1 || menuInfo.Column == colWORKPACKInternalName2)
                {
                    contextMenuPopulate.IsVisible = true;
                    contextMenuPopulate.Content   = "Autofill from Area/DocType/Disc/Dept data";
                }
                else if (menuInfo.Column == colAREA)
                {
                    contextMenuPopulate.IsVisible = true;
                    contextMenuPopulate.Content   = "Autofill From Workpack Data";
                }
                else if (menuInfo.Column == colDOCTYPE)
                {
                    contextMenuPopulate.IsVisible = true;
                    contextMenuPopulate.Content   = "Autofill From Workpack Data";
                }
                else if (menuInfo.Column == colDISCIPLINE)
                {
                    contextMenuPopulate.IsVisible = true;
                    contextMenuPopulate.Content   = "Autofill From Workpack Data";
                }
                else if (menuInfo.Column == colDEPARTMENT)
                {
                    contextMenuPopulate.IsVisible = true;
                    contextMenuPopulate.Content   = "Autofill From Workpack Data";
                }
                else if (menuInfo.Column == colPRIMARY_TITLE)
                {
                    contextMenuPopulate.IsVisible = false;
                }
                else if (menuInfo.Column == colSECONDARY_TITLE)
                {
                    contextMenuPopulate.IsVisible = false;
                }
                else if (menuInfo.Column == colESTIMATED_HOURS)
                {
                    contextMenuPopulate.IsVisible = false;
                }
                else if (menuInfo.Column == colINTERNAL_NUM)
                {
                    contextMenuPopulate.IsVisible = true;
                    contextMenuPopulate.Content   = "Autofill From Area/DocType/Disc/Dept Data";
                }
                else if (menuInfo.Column == colCLIENT_NUM)
                {
                    contextMenuPopulate.IsVisible = false;
                }
                else if (menuInfo.Column == colREVISION_NUMBER)
                {
                    contextMenuPopulate.IsVisible = false;
                }
                else if (menuInfo.Column == colTOTAL_COSTS)
                {
                    contextMenuPopulate.IsVisible = false;
                    //contextMenuBulkEdit.IsEnabled = false;
                }
                else if (menuInfo.Column == colDC_HOURS)
                {
                    contextMenuPopulate.IsVisible = false;
                    //contextMenuBulkEdit.IsEnabled = false;
                }
                else if (menuInfo.Column == colCOMMENTS)
                {
                    contextMenuPopulate.IsVisible = false;
                }
                else if (menuInfo.Column == colDELIVERABLE_TYPE)
                {
                    contextMenuPopulate.IsVisible = false;
                }
            }
        }