//
        // GridCellValueChanging event allows to prevent the cell value changing or modify the new cell value.
        // Note: Some columns hide/unhide dynamically but this does not affect the column index in the event parameters -
        //       it includes hidden columns.
        // private void queryBuilder1_GridCellValueChanging(UnionSubQuery unionSubQuery, QueryColumnList criteriaList, QueryColumnListItem criteriaItem, int column, int row, object oldValue, ref object newValue, ref bool abort)
        private void QBuilder_QueryColumnListItemChanging(QueryColumnList queryColumnList, QueryColumnListItem queryColumnListItem,
                                                          QueryColumnListItemProperty property, int conditionIndex, object oldValue, ref object newValue, ref bool abort)
        {
            if (!CbQueryColumnListItemChanging.Checked)
            {
                return;
            }

            AddRowToReport("QueryColumnListItemChanging. Changes column \"" + property + "\"");

            if (property == QueryColumnListItemProperty.Expression) // Prevent changes in the Expression column.
            {
                abort = true;
            }
            else if (property == QueryColumnListItemProperty.Alias) // Alias column. Lets add the underscore char in the beginning of all aliases, for example.
            {
                if (newValue != null && newValue is string)
                {
                    var s = (string)newValue;

                    if (s.Length > 0 && !s.StartsWith("_"))
                    {
                        s        = "_" + s;
                        newValue = s;
                    }
                }
            }
        }
        private void QBuilder_QueryColumnListItemChanged(QueryColumnList queryColumnList, QueryColumnListItem queryColumnListItem,
                                                         QueryColumnListItemProperty property, int conditionIndex, object newValue)
        {
            if (CbQueryColumnListItemChanged.Checked != true)
            {
                return;
            }

            AddRowToReport("QueryColumnListItemChanged property \"" + property + "\" changed");
        }
Exemple #3
0
        //
        // GridCellValueChanging event allows to prevent the cell value changing or modify the new cell value.
        // Note: Some columns hide/unhide dynamically but this does not affect the column index in the event parameters -
        //       it includes hidden columns.
        //
        private void QBuilder_OnQueryColumnListItemChanging(QueryColumnList querycolumnlist, QueryColumnListItem querycolumnlistitem,
                                                            QueryColumnListItemProperty property, int conditionindex, object oldvalue, ref object newValue, ref bool abort)
        {
            if (CbQueryColumnListItemChanging.IsChecked != true)
            {
                return;
            }
            BoxLogEvents.Text = "QueryColumnListItemChanging Changing the value for  property \"" + property + "\"" +
                                Environment.NewLine + BoxLogEvents.Text;

            if (property == QueryColumnListItemProperty.Expression) // Prevent changes in the Expression column.
            {
                abort = true;
                return;
            }

            if (property != QueryColumnListItemProperty.Alias)
            {
                return;
            }

            var s = newValue as string;

            if (s == null)
            {
                return;
            }

            if (s.Length <= 0 || s.StartsWith("_"))
            {
                return;
            }

            s        = "_" + s;
            newValue = s;
        }
Exemple #4
0
 private void QueryBuilder1_QueryColumnListItemChanging(QueryColumnList queryColumnList, QueryColumnListItem queryColumnListItem,
                                                        QueryColumnListItemProperty property, int conditionIndex, object oldValue, ref object newValue, ref bool abort)
 {
 }
Exemple #5
0
        private void QBuilder_OnQueryColumnListItemChanged(QueryColumnList querycolumnlist,
                                                           QueryColumnListItem querycolumnlistitem, QueryColumnListItemProperty property, int conditionindex,
                                                           object newvalue)
        {
            if (CbQueryColumnListItemChanged.IsChecked != true)
            {
                return;
            }

            BoxLogEvents.Text = "QueryColumnListItemChanged property \"" + property + "\" changed" +
                                Environment.NewLine + BoxLogEvents.Text;
        }