From 9fc944a1059f886776176bce79fd9491461b5653 Mon Sep 17 00:00:00 2001 From: deaspo Date: Fri, 15 Jan 2016 15:26:16 +0300 Subject: [PATCH] Added columnHeaderContext menu that appears on right click of at the column header. These options include: insert and delete column, reset to default width, column width, hide and unhide, filter and clear filter, group, ungroup and ungroup all. --- instat/frmEditor.Designer.vb | 160 ++++++++++++++++++++++++++++++++++- instat/frmEditor.resx | 3 + 2 files changed, 162 insertions(+), 1 deletion(-) diff --git a/instat/frmEditor.Designer.vb b/instat/frmEditor.Designer.vb index f90938e80d8..740c46679f0 100644 --- a/instat/frmEditor.Designer.vb +++ b/instat/frmEditor.Designer.vb @@ -22,14 +22,36 @@ Partial Class frmEditor 'Do not modify it using the code editor. _ Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container() Me.grdData = New unvell.ReoGrid.ReoGridControl() Me.lblNoData = New System.Windows.Forms.Label() + Me.columnContextMenuStrip = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.insertColToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.deleteColumnToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItem2 = New System.Windows.Forms.ToolStripSeparator() + Me.resetToDefaultWidthToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.columnWidthToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.hideColumnsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.unhideColumnsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItem21 = New System.Windows.Forms.ToolStripSeparator() + Me.columnFilterToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.clearColumnFilterToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItem35 = New System.Windows.Forms.ToolStripSeparator() + Me.groupColumnsToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem() + Me.ungroupColumnsToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem() + Me.ungroupAllColumnsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItem26 = New System.Windows.Forms.ToolStripSeparator() + Me.insertColPageBreakToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.removeColPageBreakToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() + Me.toolStripMenuItem32 = New System.Windows.Forms.ToolStripSeparator() + Me.ToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem() + Me.columnContextMenuStrip.SuspendLayout() Me.SuspendLayout() ' 'grdData ' Me.grdData.BackColor = System.Drawing.Color.White - Me.grdData.ColumnHeaderContextMenuStrip = Nothing + Me.grdData.ColumnHeaderContextMenuStrip = Me.columnContextMenuStrip Me.grdData.Dock = System.Windows.Forms.DockStyle.Fill Me.grdData.LeadHeaderContextMenuStrip = Nothing Me.grdData.Location = New System.Drawing.Point(0, 0) @@ -54,6 +76,121 @@ Partial Class frmEditor Me.lblNoData.Tag = "no_data_loaded" Me.lblNoData.Text = "No Data Loaded" ' + 'columnContextMenuStrip + ' + Me.columnContextMenuStrip.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.insertColToolStripMenuItem, Me.deleteColumnToolStripMenuItem, Me.toolStripMenuItem2, Me.resetToDefaultWidthToolStripMenuItem, Me.columnWidthToolStripMenuItem, Me.hideColumnsToolStripMenuItem, Me.unhideColumnsToolStripMenuItem, Me.toolStripMenuItem21, Me.columnFilterToolStripMenuItem, Me.clearColumnFilterToolStripMenuItem, Me.toolStripMenuItem35, Me.groupColumnsToolStripMenuItem1, Me.ungroupColumnsToolStripMenuItem1, Me.ungroupAllColumnsToolStripMenuItem, Me.toolStripMenuItem26, Me.insertColPageBreakToolStripMenuItem, Me.removeColPageBreakToolStripMenuItem, Me.toolStripMenuItem32, Me.ToolStripMenuItem1}) + Me.columnContextMenuStrip.Name = "columnContextMenuStrip" + Me.columnContextMenuStrip.Size = New System.Drawing.Size(193, 342) + ' + 'insertColToolStripMenuItem + ' + Me.insertColToolStripMenuItem.Name = "insertColToolStripMenuItem" + Me.insertColToolStripMenuItem.Size = New System.Drawing.Size(192, 22) + Me.insertColToolStripMenuItem.Text = "Insert &Columns" + ' + 'deleteColumnToolStripMenuItem + ' + Me.deleteColumnToolStripMenuItem.Name = "deleteColumnToolStripMenuItem" + Me.deleteColumnToolStripMenuItem.Size = New System.Drawing.Size(192, 22) + Me.deleteColumnToolStripMenuItem.Text = "Delete Columns" + ' + 'toolStripMenuItem2 + ' + Me.toolStripMenuItem2.Name = "toolStripMenuItem2" + Me.toolStripMenuItem2.Size = New System.Drawing.Size(189, 6) + ' + 'resetToDefaultWidthToolStripMenuItem + ' + Me.resetToDefaultWidthToolStripMenuItem.Name = "resetToDefaultWidthToolStripMenuItem" + Me.resetToDefaultWidthToolStripMenuItem.Size = New System.Drawing.Size(192, 22) + Me.resetToDefaultWidthToolStripMenuItem.Text = "Reset to Default Width" + ' + 'columnWidthToolStripMenuItem + ' + Me.columnWidthToolStripMenuItem.Name = "columnWidthToolStripMenuItem" + Me.columnWidthToolStripMenuItem.Size = New System.Drawing.Size(192, 22) + Me.columnWidthToolStripMenuItem.Text = "Column &Width..." + ' + 'hideColumnsToolStripMenuItem + ' + Me.hideColumnsToolStripMenuItem.Name = "hideColumnsToolStripMenuItem" + Me.hideColumnsToolStripMenuItem.Size = New System.Drawing.Size(192, 22) + Me.hideColumnsToolStripMenuItem.Text = "Hide" + ' + 'unhideColumnsToolStripMenuItem + ' + Me.unhideColumnsToolStripMenuItem.Name = "unhideColumnsToolStripMenuItem" + Me.unhideColumnsToolStripMenuItem.Size = New System.Drawing.Size(192, 22) + Me.unhideColumnsToolStripMenuItem.Text = "Unhide" + ' + 'toolStripMenuItem21 + ' + Me.toolStripMenuItem21.Name = "toolStripMenuItem21" + Me.toolStripMenuItem21.Size = New System.Drawing.Size(189, 6) + ' + 'columnFilterToolStripMenuItem + ' + Me.columnFilterToolStripMenuItem.Name = "columnFilterToolStripMenuItem" + Me.columnFilterToolStripMenuItem.Size = New System.Drawing.Size(192, 22) + Me.columnFilterToolStripMenuItem.Text = "Filter" + ' + 'clearColumnFilterToolStripMenuItem + ' + Me.clearColumnFilterToolStripMenuItem.Name = "clearColumnFilterToolStripMenuItem" + Me.clearColumnFilterToolStripMenuItem.Size = New System.Drawing.Size(192, 22) + Me.clearColumnFilterToolStripMenuItem.Text = "Clear Filter" + ' + 'toolStripMenuItem35 + ' + Me.toolStripMenuItem35.Name = "toolStripMenuItem35" + Me.toolStripMenuItem35.Size = New System.Drawing.Size(189, 6) + ' + 'groupColumnsToolStripMenuItem1 + ' + Me.groupColumnsToolStripMenuItem1.Name = "groupColumnsToolStripMenuItem1" + Me.groupColumnsToolStripMenuItem1.Size = New System.Drawing.Size(192, 22) + Me.groupColumnsToolStripMenuItem1.Text = "Group" + ' + 'ungroupColumnsToolStripMenuItem1 + ' + Me.ungroupColumnsToolStripMenuItem1.Name = "ungroupColumnsToolStripMenuItem1" + Me.ungroupColumnsToolStripMenuItem1.Size = New System.Drawing.Size(192, 22) + Me.ungroupColumnsToolStripMenuItem1.Text = "Ungroup" + ' + 'ungroupAllColumnsToolStripMenuItem + ' + Me.ungroupAllColumnsToolStripMenuItem.Name = "ungroupAllColumnsToolStripMenuItem" + Me.ungroupAllColumnsToolStripMenuItem.Size = New System.Drawing.Size(192, 22) + Me.ungroupAllColumnsToolStripMenuItem.Text = "Ungroup All" + ' + 'toolStripMenuItem26 + ' + Me.toolStripMenuItem26.Name = "toolStripMenuItem26" + Me.toolStripMenuItem26.Size = New System.Drawing.Size(189, 6) + ' + 'insertColPageBreakToolStripMenuItem + ' + Me.insertColPageBreakToolStripMenuItem.Name = "insertColPageBreakToolStripMenuItem" + Me.insertColPageBreakToolStripMenuItem.Size = New System.Drawing.Size(192, 22) + Me.insertColPageBreakToolStripMenuItem.Text = "Insert Page Break" + ' + 'removeColPageBreakToolStripMenuItem + ' + Me.removeColPageBreakToolStripMenuItem.Name = "removeColPageBreakToolStripMenuItem" + Me.removeColPageBreakToolStripMenuItem.Size = New System.Drawing.Size(192, 22) + Me.removeColPageBreakToolStripMenuItem.Text = "Remove Page Break" + ' + 'toolStripMenuItem32 + ' + Me.toolStripMenuItem32.Name = "toolStripMenuItem32" + Me.toolStripMenuItem32.Size = New System.Drawing.Size(189, 6) + ' + 'ToolStripMenuItem1 + ' + Me.ToolStripMenuItem1.Name = "ToolStripMenuItem1" + Me.ToolStripMenuItem1.Size = New System.Drawing.Size(192, 22) + Me.ToolStripMenuItem1.Text = "Properties..." + ' 'frmEditor ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -65,6 +202,7 @@ Partial Class frmEditor Me.ShowIcon = False Me.Tag = "Data_View" Me.Text = "Data View" + Me.columnContextMenuStrip.ResumeLayout(False) Me.ResumeLayout(False) Me.PerformLayout() @@ -72,4 +210,24 @@ Partial Class frmEditor Public WithEvents grdData As unvell.ReoGrid.ReoGridControl Friend WithEvents lblNoData As Label + Private WithEvents columnContextMenuStrip As ContextMenuStrip + Private WithEvents insertColToolStripMenuItem As ToolStripMenuItem + Private WithEvents deleteColumnToolStripMenuItem As ToolStripMenuItem + Private WithEvents toolStripMenuItem2 As ToolStripSeparator + Private WithEvents resetToDefaultWidthToolStripMenuItem As ToolStripMenuItem + Private WithEvents columnWidthToolStripMenuItem As ToolStripMenuItem + Private WithEvents hideColumnsToolStripMenuItem As ToolStripMenuItem + Private WithEvents unhideColumnsToolStripMenuItem As ToolStripMenuItem + Private WithEvents toolStripMenuItem21 As ToolStripSeparator + Private WithEvents columnFilterToolStripMenuItem As ToolStripMenuItem + Private WithEvents clearColumnFilterToolStripMenuItem As ToolStripMenuItem + Private WithEvents toolStripMenuItem35 As ToolStripSeparator + Private WithEvents groupColumnsToolStripMenuItem1 As ToolStripMenuItem + Private WithEvents ungroupColumnsToolStripMenuItem1 As ToolStripMenuItem + Private WithEvents ungroupAllColumnsToolStripMenuItem As ToolStripMenuItem + Private WithEvents toolStripMenuItem26 As ToolStripSeparator + Private WithEvents insertColPageBreakToolStripMenuItem As ToolStripMenuItem + Private WithEvents removeColPageBreakToolStripMenuItem As ToolStripMenuItem + Private WithEvents toolStripMenuItem32 As ToolStripSeparator + Private WithEvents ToolStripMenuItem1 As ToolStripMenuItem End Class diff --git a/instat/frmEditor.resx b/instat/frmEditor.resx index 1af7de150c9..070af85434d 100644 --- a/instat/frmEditor.resx +++ b/instat/frmEditor.resx @@ -117,4 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + \ No newline at end of file