Exemple #1
0
        protected void AddItemToListBox(StyleFormatCondition newItem)
        {
            ItemCondition newItemCondition = new ItemCondition(newItem);

            listBoxConditions.Items.Add(newItemCondition);
            listBoxConditions.SelectedItem = newItemCondition;
        }
Exemple #2
0
        void listBoxConditions_SelectedIndexChanged(object sender, EventArgs e)
        {
            ItemCondition selectedItem = listBoxConditions.SelectedItem as ItemCondition;

            condititonItemControlMain.Init(selectedItem);
            simpleButtonRemoveCondition.Enabled = listBoxConditions.Items.Count > 0;
        }
        private void AddItemToListBox(PivotGridStyleFormatCondition item)
        {
            ItemCondition newItemCondition = new ItemCondition(item);

            listBoxControlExpressions.Items.Add(newItemCondition);
            listBoxControlExpressions.SelectedItem = newItemCondition;
        }
        private void RemoveFormatCondition()
        {
            ItemCondition condition = listBoxControlExpressions.SelectedItem as ItemCondition;

            listBoxControlExpressions.Items.Remove(listBoxControlExpressions.SelectedItem);
            SourcePivot.FormatConditions.Remove(condition.Condition);
        }
 private void listBoxControlExpressions_SelectedIndexChanged(object sender, EventArgs e)
 {
     ItemCondition selectedItem = listBoxControlExpressions.SelectedItem as ItemCondition;
     propertyGridControlAppearance.SelectedObject =  selectedItem == null ? null : selectedItem.Condition.Appearance;
     checkEditApplyToRow.EditValue = selectedItem == null ? false :(bool)selectedItem.Condition.ApplyToRow;
     UpdateEditors();
 }
Exemple #6
0
        private void simpleButtonRemoveCondition_Click(object sender, EventArgs e)
        {
            if (SourceGridView == null)
            {
                return;
            }
            ItemCondition condition = listBoxConditions.SelectedItem as ItemCondition;

            listBoxConditions.Items.Remove(listBoxConditions.SelectedItem);
            SourceGridView.FormatConditions.Remove(condition.Condition);
        }
Exemple #7
0
 void RefreshEditorsValues(ItemCondition item)
 {
     comboBoxEditCondititon.EditValue = item == null ? FormatConditionEnum.Equal : item.Condition.Condition;
     if (basEditValue1 != null && basEditValue2 != null)
     {
         basEditValue1.EditValue = item == null ? 0 : item.Condition.Value1;
         basEditValue2.EditValue = item == null ? 0 : item.Condition.Value2;
     }
     checkEditApplyToRow.EditValue = item == null ? false : item.Condition.ApplyToRow;
     propertyGridControlAppearance.SelectedObject = item == null ? null : item.Condition.Appearance;
 }
Exemple #8
0
 private void UpdateEditors(ItemCondition item)
 {
     comboBoxEditCondititon.Enabled        = (bool)(item != null);
     propertyGridControlAppearance.Enabled = (bool)(item != null);
     if (basEditValue1 != null)
     {
         basEditValue1.Visible = (bool)(item != null);
     }
     if (basEditValue1 != null)
     {
         basEditValue2.Visible = (bool)(item != null);
     }
     checkEditApplyToRow.Enabled = (bool)(item != null);
 }
Exemple #9
0
 public void Init(ItemCondition item)
 {
     if (item != null)
     {
         currentFormatCondition = item.Condition;
         CreateValues(item.Condition.Column.ColumnType);
     }
     else
     {
         currentFormatCondition = null;
     }
     RefreshEditorsValues(item);
     UpdateEditors(item);
 }
 private void listBoxControlExpressions_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     ItemCondition selectedItem = listBoxControlExpressions.SelectedItem as ItemCondition;
     if (selectedItem != null)
     {
         using (ExpressionEditorForm form = new ConditionExpressionEditorForm(selectedItem.Condition, null))
         {
             form.StartPosition = FormStartPosition.CenterParent;
             if (form.ShowDialog(this) == DialogResult.OK)
             {
                 selectedItem.Condition.Condition = FormatConditionEnum.Expression;
                 selectedItem.Condition.Expression = form.Expression;
             }
         }
     }
     listBoxControlExpressions.Refresh();
 }