protected void Grid_FillContextMenuItems(object sender, ASPxGridViewContextMenuEventArgs e) { if (e.MenuType == GridViewContextMenuType.Rows) { e.Items.Clear(); e.Items.Add(e.CreateItem("Custom item for all rows", "AllRows")); e.Items.Add(e.CreateItem("Custom item for selected rows only", "OnlySelectedRows")); e.Items.Add(e.CreateItem("Custom item for selected rows with 'Discontinued=true' only", "OnlySelectedAndDiscontinuedRows")); } }
protected void ASPxGridViewLeft_FillContextMenuItems(object sender, ASPxGridViewContextMenuEventArgs e) { var item = e.CreateItem("Export to Excel", "ExportToExcel"); item.BeginGroup = true; item.Image.IconID = "export_exporttoxls_16x16office2013"; e.Items.Add(item); item = e.CreateItem("Export to PDF", "ExportToPDF"); item.Image.IconID = "export_exporttopdf_16x16office2013"; e.Items.Add(item); item = e.CreateItem("Export to RTF", "ExportToRTF"); item.Image.IconID = "export_exporttortf_16x16office2013"; e.Items.Add(item); }
protected void Grid_FillContextMenuItems(object sender, ASPxGridViewContextMenuEventArgs e) { try { if (e.MenuType == GridViewContextMenuType.Rows) { var item = e.CreateItem("Export", "Export"); item.BeginGroup = true; e.Items.Insert(e.Items.IndexOfCommand(GridViewContextMenuCommand.Refresh), item); AddMenuSubItem(item, "PDF", "ExportToPDF", @"Images/ExportToPdf.png", true); AddMenuSubItem(item, "XLS", "ExportToXLS", @"Images/ExportToXls.png", true); AddMenuSubItem(item, "Word", "ExportToWORD", @"Images/ExportToWord.png", true); AddMenuSubItem(item, "CSV", "ExportToCSV", @"Images/ExportToCsv.png", true); } } catch (Exception ex) { var _Security = new Security(); var ErrorDesscription = ex.Message; _Security.ErrorDesscription = ex.Message; _Security.ErrorModule = "context menu on form Patients Below 15 Inquiry"; _Security.SaveError(); } }
private void GridOnFillContextMenuItems(object sender, ASPxGridViewContextMenuEventArgs e) { if (e.MenuType == GridViewContextMenuType.Columns) { var item = e.CreateItem(ColumnChooserAction.Caption, ColumnChooserAction.Id); ASPxImageHelper.SetImageProperties(item.Image, ColumnChooserAction.ImageName); e.Items[10].Visible = false; e.Items.Insert(10, item); } }
protected void grid_FillContextMenuItems(object sender, ASPxGridViewContextMenuEventArgs e) { if (e.MenuType == GridViewContextMenuType.Rows) { var item = e.CreateItem("Export", "Export"); item.BeginGroup = true; e.Items.Insert(e.Items.IndexOfCommand(GridViewContextMenuCommand.Refresh), item); AddMenuSubItem(item, "PDF", "ExportToPDF", @"/Images/doc_pdf.png", true); AddMenuSubItem(item, "XLS", "ExportToXLS", @"/Images/doc_excel_table.png", true); } }
protected void Grid_FillContextMenuItems(object sender, ASPxGridViewContextMenuEventArgs e) { if (e.MenuType == GridViewContextMenuType.Rows) { var item = e.CreateItem("Export", "Export"); item.BeginGroup = true; e.Items.Insert(e.Items.IndexOfCommand(GridViewContextMenuCommand.Refresh), item); AddMenuSubItem(item, "WORD", "ExportToWord", @"Images/ExportToWord.png", true); AddMenuSubItem(item, "PDF", "ExportToPDF", @"Images/ExportToPdf.png", true); AddMenuSubItem(item, "EXCEL", "ExportToXLS", @"Images/ExportToXls.png", true); AddMenuSubItem(item, "CSV", "ExportToCSV", @"Images/ExportToXls.png", true); } }
protected void PatrolsGrid_FillContextMenuItems(object sender, ASPxGridViewContextMenuEventArgs e) { if (e.MenuType == GridViewContextMenuType.Rows) { e.Items.Add("جديد", "جديد"); e.Items.Add("تعديل", "تعديل"); e.Items.Add("حذف", "حذف"); var item = e.CreateItem("تقرير", "تقرير"); item.BeginGroup = true; PatrolsGrid_AddMenuSubItem(item, "PDF", "تقرير PDF", @"~/Content/ExportToPdf.png", true); PatrolsGrid_AddMenuSubItem(item, "XLS", "تقرير Excel", @"~/Content/ExportToXls.png", true); e.Items.Add(item); } }
protected void GridView_FillContextMenuItems(object sender, ASPxGridViewContextMenuEventArgs e) { switch (e.MenuType) { case GridViewContextMenuType.Columns: //var menuItem = e.Items.FindByCommand(GridViewContextMenuCommand.HideColumn); //menuItem.Text = CommonConstants.MenuItem_HideColumn; break; case GridViewContextMenuType.Rows: GridViewContextMenuItem item = e.Items.FindByCommand(GridViewContextMenuCommand.ExportMenu); item.Image.IconID = IconID.ExportExport16x16office2013; item.Items.Add("Xuất ra File Excel", "CustomExportToXLS").Image.IconID = IconID.ExportExport16x16office2013; item = e.CreateItem(CommonConstants.MenuItem_DetailRow, "DetailRow"); item.Image.IconID = IconID.GridGrid16x16office2013; e.Items.Insert(e.Items.IndexOfCommand(GridViewContextMenuCommand.NewRow) + 1, item); item = e.CreateItem(CommonConstants.MenuItem_CloneRow, "CloneRow"); item.Image.IconID = IconID.XafActionClonemergeCloneObjectSvg16x16; e.Items.Insert(e.Items.IndexOfCommand(GridViewContextMenuCommand.NewRow) + 1, item); item = e.CreateItem(CommonConstants.MenuItem_Actived, "Actived"); item.Image.IconID = IconID.RicheditTrackingchangesAccept16x16; item.BeginGroup = true; e.Items.Insert(e.Items.IndexOfCommand(GridViewContextMenuCommand.Refresh) + 1, item); e.Items.Add(CommonConstants.MenuItem_InActived, "InActived").Image.IconID = IconID.XafActionCancelSvg16x16; e.Items.Add(CommonConstants.MenuItem_Blocked, "Blocked").Image.IconID = IconID.IconbuilderSecurityLockSvg16x16; e.Items.Add(CommonConstants.MenuItem_UnBlocked, "UnBlocked").Image.IconID = IconID.IconbuilderSecurityUnlockSvg16x16; e.Items.Add(CommonConstants.MenuItem_InActivedBlocked, "InActivedBlocked").Image.IconID = IconID.SnapRemoveheader16x16; e.Items.Add(CommonConstants.MenuItem_ActivedUnBlocked, "ActivedUnBlocked").Image.IconID = IconID.SnapSnapinsertheader16x16; //e.Items.Add("Select All", "SelectAll"); //e.Items.Add("Deselect All", "DeselectAll"); PageToolbar.Items.FindByName("NewRow").Text = e.Items.FindByName("NewRow").Text; e.Items.FindByName("NewRow").Enabled = PageToolbar.Items.FindByName("NewRow").Enabled; PageToolbar.Items.FindByName("EditRow").Text = e.Items.FindByName("EditRow").Text; e.Items.FindByName("EditRow").Enabled = PageToolbar.Items.FindByName("EditRow").Enabled; PageToolbar.Items.FindByName("DeleteRow").Text = e.Items.FindByName("DeleteRow").Text; e.Items.FindByName("DeleteRow").Enabled = PageToolbar.Items.FindByName("DeleteRow").Enabled; PageToolbar.Items.FindByName("Export").Text = e.Items.FindByName("ExportMenu").Text; e.Items.FindByName("ExportMenu").Enabled = PageToolbar.Items.FindByName("Export").Enabled; e.Items.FindByName("CloneRow").Text = PageToolbar.Items.FindByName("CloneRow").Text; e.Items.FindByName("CloneRow").Enabled = PageToolbar.Items.FindByName("CloneRow").Enabled; e.Items.FindByName("DetailRow").Text = PageToolbar.Items.FindByName("DetailRow").Text; e.Items.FindByName("DetailRow").Enabled = PageToolbar.Items.FindByName("DetailRow").Enabled; break; default: break; } }