コード例 #1
0
        void CreatePopupMenuItem(PopupMenuEventArgs e, string caption, EventHandler eventHandler)
        {
            PopupMenuItem item = new PopupMenuItem();

            item.Caption = caption;
            item.Click  += eventHandler;
            e.Menu.Items.Add(item);
        }
コード例 #2
0
ファイル: Popup.cs プロジェクト: lowkemedia/Libraries
 public void MenuButtonClicked(PopupMenuEventArgs popupMenuEventArgs)
 {
     Selected = popupMenuEventArgs.MenuItem;
     if (onMenuSelectedEvent != null)
     {
         onMenuSelectedEvent.Invoke(popupMenuEventArgs);
     }
     HidePopup();
 }
コード例 #3
0
        void OnPopupMenuCustomization(object sender, PopupMenuEventArgs e)
        {
            if (e.MenuType == GridPopupMenuType.DataRow)
            {
                e.Menu.Items.Clear();
                PopupMenuItem itemDetail = new PopupMenuItem();
                itemDetail.Caption = "lihat profil";
                itemDetail.Click  += ItemDetailClick;
                e.Menu.Items.Insert(0, itemDetail);

                PopupMenuItem itemDelete = new PopupMenuItem();
                itemDelete.Caption = "delete";
                itemDelete.Click  += ItemDeleteClick;
                e.Menu.Items.Insert(1, itemDelete);
            }
        }
コード例 #4
0
        void OnPopupMenuCustomization(object sender, PopupMenuEventArgs e)
        {
            if (e.MenuType == GridPopupMenuType.DataRow)
            {
                string idValue;
                idValue = grid.GetCellValue(e.RowHandle, "ID").ToString();
                if (!string.IsNullOrEmpty(idValue))
                {
                    _idEvento = Convert.ToInt64(idValue);
                }

                e.Menu.Items.Clear();
                PopupMenuItem itemFilter = new PopupMenuItem();
                itemFilter.Caption = "Ver evento";
                itemFilter.Click  += VerEventoClick;
                e.Menu.Items.Insert(0, itemFilter);
            }
        }
コード例 #5
0
        void OnPopupMenuCustomization(object sender, PopupMenuEventArgs e)
        {
            if ((e.MenuType != GridPopupMenuType.Header) || grid.ColumnsAutoWidth)
            {
                return;
            }

            ActiveColumn = e.Column;

            if ((e.Column.FixedStyle == FixedStyle.Right) || (e.Column.FixedStyle == FixedStyle.None))
            {
                CreatePopupMenuItem(e, "Fix Column to Left", OnLeftFixedColumnItemClick);
            }

            if ((e.Column.FixedStyle == FixedStyle.Left) || (e.Column.FixedStyle == FixedStyle.None))
            {
                CreatePopupMenuItem(e, "Fix Column to Right", OnRightFixedColumnItemClick);
            }

            if ((e.Column.FixedStyle == FixedStyle.Left) || (e.Column.FixedStyle == FixedStyle.Right))
            {
                CreatePopupMenuItem(e, "Unfix Column", OnNoneFixedColumnItemClick);
            }
        }