void CreatePopupMenuItem(PopupMenuEventArgs e, string caption, EventHandler eventHandler) { PopupMenuItem item = new PopupMenuItem(); item.Caption = caption; item.Click += eventHandler; e.Menu.Items.Add(item); }
public void MenuButtonClicked(PopupMenuEventArgs popupMenuEventArgs) { Selected = popupMenuEventArgs.MenuItem; if (onMenuSelectedEvent != null) { onMenuSelectedEvent.Invoke(popupMenuEventArgs); } HidePopup(); }
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); } }
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); } }
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); } }