Esempio n. 1
0
        private void ShowFieldMenu(ReportFieldListBox sender, ReportField reportField)
        {
            _moveToColumnLabelsMenuItem.Enabled = sender.FieldType != ReportFieldType.Column;
            _moveToRowLabelsMenuItem.Enabled    = sender.FieldType != ReportFieldType.Row;
            _moveToValuesMenuItem.Enabled       = sender.FieldType != ReportFieldType.Value;
            _aggregateMenuItem.Enabled          = sender.FieldType == ReportFieldType.Value;

            int index = sender.Items.IndexOf(reportField);

            _moveUpMenuItem.Enabled          = index > 0;
            _moveToBeginningMenuItem.Enabled = index > 0;
            _moveDownMenuItem.Enabled        = index < sender.Items.Count - 1;
            _moveToEndMenuItem.Enabled       = index < sender.Items.Count - 1;

            foreach (ToolStripMenuItem menuItem in _aggregateMenuItem.DropDownItems)
            {
                menuItem.Checked = (ReportFieldTransform)menuItem.Tag == reportField.Transform;
            }

            var bounds = sender.GetItemRectangle(index);

            _selectedField = new SelectedField(sender, reportField);
            _fieldContextMenu.Show(sender, bounds.Left, bounds.Bottom + 1);
        }
Esempio n. 2
0
 public SelectedField(ReportFieldListBox listBox, ReportField field)
 {
     ListBox = listBox;
     Field   = field;
 }