Exemple #1
0
 public virtual bool ShowContextMenu(IContextMenuProvider contextMenuProvider, Point location)
 {
   if (this.rootElement == null)
     return false;
   RadDropDownMenu radDropDownMenu = contextMenuProvider.ContextMenu ?? contextMenuProvider.MergeMenus((IContextMenuManager) this);
   GridViewContextMenuManager.UpdateMenuTheme((GridVisualElement) this.rootElement, radDropDownMenu);
   ContextMenuOpeningEventArgs args = new ContextMenuOpeningEventArgs(contextMenuProvider, radDropDownMenu);
   this.rootElement.Template.EventDispatcher.RaiseEvent<ContextMenuOpeningEventArgs>(EventDispatcher.ContextMenuOpening, (object) contextMenuProvider, args);
   RadDropDownMenu contextMenu = args.ContextMenu;
   if (args.Cancel || contextMenu == null || contextMenu.Items.Count == 0)
     return false;
   if (this.rootElement.RightToLeft)
   {
     contextMenu.RightToLeft = RightToLeft.Yes;
   }
   else
   {
     contextMenu.RightToLeft = RightToLeft.No;
     contextMenu.HorizontalPopupAlignment = HorizontalPopupAlignment.LeftToLeft;
   }
   contextMenu.Show(this.rootElement.ElementTree.Control, location);
   this.contextMenu = contextMenu;
   this.contextMenu.PopupClosed += new RadPopupClosedEventHandler(this.ContextMenu_PopupClosed);
   return true;
 }
Exemple #2
0
        private void radGridView_ContextMenuOpening(object sender, Telerik.WinControls.UI.ContextMenuOpeningEventArgs e)
        {
            //GridDataCellElement cell = e.ContextMenuProvider as GridDataCellElement;
            //_IdItem = Convert.ToInt32(this.radGridView.Rows[cell.RowIndex].Cells["IdArchive"].Value);

            e.ContextMenu = menu.DropDown;
        }
        private void OptionsButton_DropDownOpening(object sender, CancelEventArgs e)
        {
            this.UnsubscribeChildMenuItems(this.chooseColumnsMenuItem);
            this.chooseColumnsMenuItem.Items.Clear();
            this.AddColumnMenuItems(this.chooseColumnsMenuItem, (GridViewTemplate)this.GridControl.MasterTemplate, LocalizationProvider <RadGridLocalizationProvider> .CurrentProvider.GetLocalizedString("SearchRowMenuItemMasterTemplate"));
            ContextMenuOpeningEventArgs args = new ContextMenuOpeningEventArgs((IContextMenuProvider)this, this.OptionsButton.DropDownMenu);

            this.GridViewElement.Template.EventDispatcher.RaiseEvent <ContextMenuOpeningEventArgs>(EventDispatcher.ContextMenuOpening, (object)this, args);
            e.Cancel = args.Cancel;
        }
 private void gvDetalle_ContextMenuOpening(object sender, Telerik.WinControls.UI.ContextMenuOpeningEventArgs e)
 {
     try {
         if (this.gvDetalle.RowCount > 0)
         {
             RadDropDownMenu Menu     = new RadDropDownMenu();
             RadMenuItem     MenuItem = new RadMenuItem("Exportar a Excel");
             MenuItem.Click += new EventHandler(MenuItem_Click);
             Menu.Items.Add(MenuItem);
             e.ContextMenu = Menu;
         }
     } catch (Exception ex) {
         throw ex;
     }
 }
Exemple #5
0
        private void radGridView2_ContextMenuOpening(object sender, Telerik.WinControls.UI.ContextMenuOpeningEventArgs e)
        {
            GridDataCellElement cell = e.ContextMenuProvider as GridDataCellElement;

            if ((bool)radGridView2.Rows[cell.RowIndex].Cells["IsCheckOut"].Value)
            {
                menu.Items[2].Enabled = true;
                menu.Items[1].Enabled = false;
            }
            else
            {
                menu.Items[2].Enabled = false;
                menu.Items[1].Enabled = true;
            }
            e.ContextMenu = menu.DropDown;
        }
        private void FilterFunctionButton_Click(object sender, EventArgs e)
        {
            RadDropDownMenu filterMenu = this.CreateFilterMenu(this.DataColumnInfo.DataType);

            filterMenu.RightToLeft = this.RightToLeft ? RightToLeft.Yes : RightToLeft.No;
            ContextMenuOpeningEventArgs args = new ContextMenuOpeningEventArgs((IContextMenuProvider)this, filterMenu);

            this.GridViewElement.Template.EventDispatcher.RaiseEvent <ContextMenuOpeningEventArgs>(EventDispatcher.ContextMenuOpening, (object)this, args);
            if (args.Cancel || args.ContextMenu == null)
            {
                return;
            }
            Point point = args.ContextMenu.RightToLeft == RightToLeft.Yes ? new Point(this.filterFunctionButton.Size.Width, this.filterFunctionButton.Size.Height) : new Point(0, this.filterFunctionButton.Size.Height);

            args.ContextMenu.Show((RadItem)this.filterFunctionButton, point, RadDirection.Down);
            this.Focus();
        }
Exemple #7
0
        void radGridViewAdvanced_ContextMenuOpening(object sender, Telerik.WinControls.UI.ContextMenuOpeningEventArgs e)
        {
            RadDropDownMenu menu     = new RadDropDownMenu();
            RadMenuItem     menuItem = new RadMenuItem("مشاهده اسناد پرونده");

            menuItem.Click += new EventHandler(menuItem_Click);
            menu.Items.Add(menuItem);
            e.ContextMenu.Items.Add(menuItem);

            for (int i = 0; i < e.ContextMenu.Items.Count; i++)
            {
                if (e.ContextMenu.Items[i].Text == "مخفی کردن ستون")
                {
                    string name = e.ContextMenu.Items[i].Name;
                    e.ContextMenu.Items[i].Click += DossierDocumentsManage2_Click;
                    //// hide the Conditional Formatting option from the header row context menu
                    //e.ContextMenu.Items[i].Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
                    //// hide the separator below the CF option
                    //e.ContextMenu.Items[i + 1].Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
                }
                if (e.ContextMenu.Items[i].Text == "قالب بندی مشروط")
                {
                    e.ContextMenu.Items[i].Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
                }
                if (e.ContextMenu.Items[i].Text == "گروهبندی بر حسب این ستون")
                {
                    e.ContextMenu.Items[i].Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
                }
                if (e.ContextMenu.Items[i].Text == "انتخابگر ستون")
                {
                    e.ContextMenu.Items[i].Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
                }
                if (e.ContextMenu.Items[i].Text == "حالت ستون")
                {
                    e.ContextMenu.Items[i].Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
                }
                if (e.ContextMenu.Items[i].Text == "اندازه بهینه ستون")
                {
                    e.ContextMenu.Items[i].Text   = "بازیابی ستون ها";
                    e.ContextMenu.Items[i].Click += DossierDocumentsManage3_Click;
                }
            }
        }
Exemple #8
0
        private void table_frForfait_ContextMenuOpening(object sender, Telerik.WinControls.UI.ContextMenuOpeningEventArgs e)
        {
            e.ContextMenu.Items.Clear();
            RadMenuItem Item1Forfait = new RadMenuItem();

            Item1Forfait.Text   = "Remboursée";
            Item1Forfait.Click += new EventHandler(Item1Forfait_Click);
            RadMenuItem Item2Forfait = new RadMenuItem();

            Item2Forfait.Text   = "Saisie clôturée";
            Item2Forfait.Click += new EventHandler(Item2Forfait_Click);
            RadMenuItem Item3Forfait = new RadMenuItem();

            Item3Forfait.Text   = "Fiche créée, saisie en cours";
            Item3Forfait.Click += new EventHandler(Item3Forfait_Click);
            RadMenuItem Item4Forfait = new RadMenuItem();

            Item4Forfait.Text   = "Validée et mise en paiement";
            Item4Forfait.Click += new EventHandler(Item4Forfait_Click);
            e.ContextMenu.Items.Add(Item1Forfait);
            e.ContextMenu.Items.Add(Item2Forfait);
            e.ContextMenu.Items.Add(Item3Forfait);
            e.ContextMenu.Items.Add(Item4Forfait);
        }
        private void dgvProducts_ContextMenuOpening(object sender, Telerik.WinControls.UI.ContextMenuOpeningEventArgs e)
        {
            GridDataCellElement cell = e.ContextMenuProvider as GridDataCellElement;

            productID = cell.RowInfo.Cells["ProductID"].Value.ToInt();
        }
Exemple #10
0
 private void radGridView1_ContextMenuOpening(object sender, Telerik.WinControls.UI.ContextMenuOpeningEventArgs e)
 {
     e.Cancel = true;
 }
 private void EditorControl_ContextMenuOpening(object sender, ContextMenuOpeningEventArgs e)
 {
     e.ContextMenu = (RadDropDownMenu)null;
 }
Exemple #12
0
 private void gvServers_ContextMenuOpening(object sender, Telerik.WinControls.UI.ContextMenuOpeningEventArgs e)
 {
     e.ContextMenu = cmServers.DropDown;
 }
Exemple #13
0
 private void radGridViewStorage_ContextMenuOpening(object sender, Telerik.WinControls.UI.ContextMenuOpeningEventArgs e)
 {
     e.ContextMenu = menu.DropDown;
 }