예제 #1
0
        public void TestAddDateFilterDateTimePicker_Composites()
        {
            //---------------Set up test pack-------------------
            IControlFactory      factory             = GetControlFactory();
            IFilterClauseFactory filterClauseFactory = new DataViewFilterClauseFactory();
            IFilterControl       filterControl       = factory.CreateFilterControl();
            DateTime             testDate1           = DateTime.Now;
            DateTime             testDate2           = testDate1.AddDays(1);

            filterControl.AddDateFilterDateTimePicker("test1:", "TestColumn1", testDate1, FilterClauseOperator.OpLessThan, false);
            filterControl.AddDateFilterDateTimePicker("test2:", "TestColumn2", testDate2, FilterClauseOperator.OpLessThan, false);

            //---------------Execute Test ----------------------
            string expectedFilterClause = filterControl.GetFilterClause().GetFilterClauseString();

            //---------------Test Result -----------------------
            IFilterClause clause1 =
                filterClauseFactory.CreateDateFilterClause("TestColumn1", FilterClauseOperator.OpLessThan, new DateTime(testDate1.Year, testDate1.Month, testDate1.Day));
            IFilterClause clause2 =
                filterClauseFactory.CreateDateFilterClause("TestColumn2", FilterClauseOperator.OpLessThan, new DateTime(testDate2.Year, testDate2.Month, testDate2.Day));
            IFilterClause compClause =
                filterClauseFactory.CreateCompositeFilterClause(clause1, FilterClauseCompositeOperator.OpAnd, clause2);

            Assert.AreEqual(compClause.GetFilterClauseString(), expectedFilterClause);

            //---------------Tear Down -------------------------
        }
예제 #2
0
        public void Test_Search_LikeWithString()
        {
            IFilterClause filterClause =
                _filterClauseFactory.CreateStringFilterClause("TestColumn", FilterClauseOperator.OpLike, "testvalue");

            Assert.AreEqual("TestColumn like '%testvalue%'", filterClause.GetFilterClauseString("%", ""));
        }
예제 #3
0
        public void TestEqualsWithString()
        {
            IFilterClause filterClause =
                _filterClauseFactory.CreateStringFilterClause("TestColumn", FilterClauseOperator.OpEquals, "testvalue");

            Assert.AreEqual("TestColumn = 'testvalue'", filterClause.GetFilterClauseString());
        }
예제 #4
0
        public void TestEqualsWithInteger()
        {
            IFilterClause filterClause =
                _filterClauseFactory.CreateIntegerFilterClause("TestColumn", FilterClauseOperator.OpEquals, 12);

            Assert.AreEqual("TestColumn = 12", filterClause.GetFilterClauseString());
        }
 /// <summary>
 /// Constructor to initialise a new composite filter clause
 /// </summary>
 /// <param name="leftClause">The left filter clause</param>
 /// <param name="compositeOperator">The operator to connect the
 /// clauses</param>
 /// <param name="rightClause">The right filter clause</param>
 public DataViewCompositeFilterClause(IFilterClause leftClause, FilterClauseCompositeOperator compositeOperator,
                                      IFilterClause rightClause)
 {
     _leftClause = leftClause;
     _compositeOperator = compositeOperator;
     _rightClause = rightClause;
 }
        public void TestTwoStringTextBoxFilter()
        {
            //---------------Set up test pack-------------------
            IFilterClauseFactory itsFilterClauseFactory = new DataViewFilterClauseFactory();
            IFilterControl       filterControl          = GetControlFactory().CreateFilterControl();
            ITextBox             tb = filterControl.AddStringFilterTextBox("Test:", "TestColumn");

            tb.Text = "testvalue";
            ITextBox tb2 = filterControl.AddStringFilterTextBox("Test:", "TestColumn2");

            tb2.Text = "testvalue2";

            //---------------Execute Test ----------------------
            string filterClauseString = filterControl.GetFilterClause().GetFilterClauseString();

            //---------------Test Result -----------------------
            IFilterClause clause1 =
                itsFilterClauseFactory.CreateStringFilterClause("TestColumn", FilterClauseOperator.OpLike, "testvalue");
            IFilterClause clause2 =
                itsFilterClauseFactory.CreateStringFilterClause("TestColumn2", FilterClauseOperator.OpLike, "testvalue2");
            IFilterClause fullClause =
                itsFilterClauseFactory.CreateCompositeFilterClause(clause1, FilterClauseCompositeOperator.OpAnd, clause2);

            Assert.AreEqual(fullClause.GetFilterClauseString(), filterClauseString);

            //---------------Tear Down -------------------------
        }
예제 #7
0
 /// <summary>
 /// Constructor to initialise a new composite filter clause
 /// </summary>
 /// <param name="leftClause">The left filter clause</param>
 /// <param name="compositeOperator">The operator to connect the
 /// clauses</param>
 /// <param name="rightClause">The right filter clause</param>
 public DataViewCompositeFilterClause(IFilterClause leftClause, FilterClauseCompositeOperator compositeOperator,
                                      IFilterClause rightClause)
 {
     _leftClause        = leftClause;
     _compositeOperator = compositeOperator;
     _rightClause       = rightClause;
 }
예제 #8
0
        public void TestWithColumnNameMoreThanOneWord()
        {
            IFilterClause filterClause =
                _filterClauseFactory.CreateIntegerFilterClause("Test Column", FilterClauseOperator.OpEquals, 12);

            Assert.AreEqual("[Test Column] = 12", filterClause.GetFilterClauseString());
        }
        public void TestAdd_DateRangeFilterComboBoxExclusive()
        {
            //---------------Set up test pack-------------------

            IFilterControl       filterControl       = GetControlFactory().CreateFilterControl();
            IFilterClauseFactory filterClauseFactory = new DataViewFilterClauseFactory();
            DateTime             testDate            = new DateTime(2007, 1, 2, 3, 4, 5, 6);

            //---------------Execute Test ----------------------
            IDateRangeComboBox dr1 = filterControl.AddDateRangeFilterComboBox("test", "test", false, false);

            dr1.UseFixedNowDate = true;
            dr1.FixedNowDate    = testDate;
            dr1.SelectedItem    = "Today";
            IFilterClause clause1 =
                filterClauseFactory.CreateDateFilterClause("test", FilterClauseOperator.OpGreaterThan,
                                                           new DateTime(2007, 1, 2, 0, 0, 0));
            IFilterClause clause2 =
                filterClauseFactory.CreateDateFilterClause("test", FilterClauseOperator.OpLessThan,
                                                           new DateTime(2007, 1, 2, 23, 59, 59, 999));
            IFilterClause compClause =
                filterClauseFactory.CreateCompositeFilterClause(clause1, FilterClauseCompositeOperator.OpAnd, clause2);

            //---------------Test Result -----------------------

            Assert.AreEqual(compClause.GetFilterClauseString(), filterControl.GetFilterClause().GetFilterClauseString());
        }
예제 #10
0
        public void Test_Search_EqualsWithInteger()
        {
            //---------------Execute Test ----------------------
            IFilterClause filterClause =
                _filterClauseFactory.CreateIntegerFilterClause("TestColumn", FilterClauseOperator.OpEquals, 12);

            //---------------Test Result -----------------------
            Assert.AreEqual("TestColumn = 12", filterClause.GetFilterClauseString("%", ""));
        }
예제 #11
0
        public void Test_Search_EqualsWithString()
        {
            //---------------Execute Test ----------------------
            IFilterClause filterClause =
                _filterClauseFactory.CreateStringFilterClause("TestColumn", FilterClauseOperator.OpEquals, "testvalue");

            //---------------Test Result -----------------------
            Assert.AreEqual("TestColumn = 'testvalue'", filterClause.GetFilterClauseString("%", ""));
            //---------------Tear Down -------------------------
        }
예제 #12
0
        public void Test_Search_DateEquals()
        {
            DateTime filterValue = DateTime.Now.AddDays(-2);
            //---------------Execute Test ----------------------
            IFilterClause filterClause =
                _filterClauseFactory.CreateDateFilterClause("TestColumn", FilterClauseOperator.OpEquals, filterValue);
            //---------------Test Result -----------------------
            string expectedFilterClause = string.Format("TestColumn = '{0}'", filterValue.ToString("dd MMM yyyy HH:mm:ss"));

            Assert.AreEqual(expectedFilterClause, filterClause.GetFilterClauseString("%", "'"));
        }
        public void TestCreateNullFilterClause()
        {
            //---------------Set up test pack-------------------
            IFilterClauseFactory itsFilterClauseFactory = new DataViewFilterClauseFactory();
            //---------------Execute Test ----------------------
            IFilterClause filterClause =
                itsFilterClauseFactory.CreateNullFilterClause();

            //---------------Test Result -----------------------
            Assert.AreEqual("", filterClause.GetFilterClauseString());
        }
        public void TestCompositeWithNullClauses()
        {
            IFilterClause nullFilterClause = itsFilterClauseFactory.CreateNullFilterClause();
            IFilterClause intFilterClause  =
                itsFilterClauseFactory.CreateIntegerFilterClause("TestColumnInt", FilterClauseOperator.OpEquals, 12);
            IFilterClause compositeClause =
                itsFilterClauseFactory.CreateCompositeFilterClause(nullFilterClause, FilterClauseCompositeOperator.OpOr,
                                                                   intFilterClause);

            Assert.AreEqual("TestColumnInt = 12", compositeClause.GetFilterClauseString());
        }
        public void TestCompositeEqualsWithOr()
        {
            IFilterClause clause1 =
                filterClauseFactory.CreateStringFilterClause("h a", FilterClauseOperator.OpEquals, "Peter");
            IFilterClause clause2 =
                filterClauseFactory.CreateStringFilterClause("h a", FilterClauseOperator.OpEquals, "Kelly");
            IFilterClause compositeClause =
                filterClauseFactory.CreateCompositeFilterClause(clause1, FilterClauseCompositeOperator.OpOr, clause2);

            dv.RowFilter = compositeClause.GetFilterClauseString();
            Assert.AreEqual(2, dv.Count);
        }
예제 #16
0
        public void Test_GetFilterClause_WhenOpIs_ShouldNotSetValueDelimiters()
        {
            //---------------Set up test pack-------------------
            string propertyName = TestUtil.GetRandomString();
            const FilterClauseOperator filterClauseOperator = FilterClauseOperator.Is;
            const string       filterValue = "NULL";
            StringStaticFilter filter      = new StringStaticFilter(propertyName, filterClauseOperator, filterValue);
            //---------------Execute Test ----------------------
            IFilterClause filterClause = filter.GetFilterClause(new DataViewFilterClauseFactory());

            //---------------Test Result -----------------------
            Assert.AreEqual(string.Format("{0} Is {1}", propertyName, filterValue), filterClause.GetFilterClauseString());
        }
예제 #17
0
        public void Test_GetFilterClause()
        {
            //---------------Set up test pack-------------------
            string propertyName = TestUtil.GetRandomString();
            const FilterClauseOperator filterClauseOperator = FilterClauseOperator.OpGreaterThan;
            const string       filterValue = "constantValue";
            StringStaticFilter filter      = new StringStaticFilter(propertyName, filterClauseOperator, filterValue);
            //---------------Execute Test ----------------------
            IFilterClause filterClause = filter.GetFilterClause(new DataViewFilterClauseFactory());

            //---------------Test Result -----------------------
            Assert.AreEqual(string.Format("{0} > '{1}'", propertyName, filterValue), filterClause.GetFilterClauseString());
        }
        public void TestCompositeWithOr()
        {
            IFilterClause stringFilterClause =
                itsFilterClauseFactory.CreateStringFilterClause("TestColumnString", FilterClauseOperator.OpEquals,
                                                                "testvalue");
            IFilterClause intFilterClause =
                itsFilterClauseFactory.CreateIntegerFilterClause("TestColumnInt", FilterClauseOperator.OpEquals, 12);
            IFilterClause compositeClause =
                itsFilterClauseFactory.CreateCompositeFilterClause(stringFilterClause,
                                                                   FilterClauseCompositeOperator.OpOr, intFilterClause);

            Assert.AreEqual("(TestColumnString = 'testvalue') or (TestColumnInt = 12)",
                            compositeClause.GetFilterClauseString());
        }
예제 #19
0
        public void Test_FilterClause_WithEnum()
        {
            //---------------Set up test pack-------------------

            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            IFilterClause filterClause =
                _filterClauseFactory.CreateEnumFilterClause("TestColumn", FilterClauseOperator.OpEquals, PurchaseOrderStatus.Processed);

            //---------------Test Result -----------------------
            string expectedFilterClause = string.Format("TestColumn = '{0}'", PurchaseOrderStatus.Processed);

            Assert.AreEqual(expectedFilterClause, filterClause.GetFilterClauseString("%", "'"));
        }
        public void TestAddStringFilterCheckBox()
        {
            //---------------Set up test pack-------------------
            IFilterClauseFactory filterClauseFactory = new DataViewFilterClauseFactory();
            IFilterControl       filterControl       = GetControlFactory().CreateFilterControl();

            //---------------Execute Test ----------------------
            filterControl.AddBooleanFilterCheckBox("Test?", "TestColumn", true);
            //---------------Test Result -----------------------
            IFilterClause clause =
                filterClauseFactory.CreateStringFilterClause("TestColumn", FilterClauseOperator.OpEquals, "true");

            Assert.AreEqual(clause.GetFilterClauseString(), filterControl.GetFilterClause().GetFilterClauseString());

            //---------------Tear Down -------------------------
        }
        public void TestGetComboBoxFilterClauseNoSelection()
        {
            //---------------Set up test pack-------------------
            IFilterClauseFactory filterClauseFactory = new DataViewFilterClauseFactory();
            IFilterControl       filterControl       = GetControlFactory().CreateFilterControl();
            IComboBox            comboBox            = TestFilterControlManager.GetFilterComboBox_2Items(filterControl);

            //---------------Execute Test ----------------------
            comboBox.SelectedIndex = -1;
            string filterClauseString = filterControl.GetFilterClause().GetFilterClauseString();
            //---------------Test Result -----------------------
            IFilterClause clause = filterClauseFactory.CreateNullFilterClause();

            Assert.AreEqual(clause.GetFilterClauseString(), filterClauseString);
            //---------------Tear Down -------------------------
        }
예제 #22
0
        ///<summary>
        /// Returns the filter clause for this control
        ///</summary>
        ///<param name="filterClauseFactory"></param>
        ///<returns></returns>
        public virtual IFilterClause GetFilterClause(IFilterClauseFactory filterClauseFactory)
        {
            DateTime date = _dateTimePicker.Value;

            date = date.Date;
            if (_filterClauseOperator == FilterClauseOperator.OpLike)
            {
                IFilterClause startClause = filterClauseFactory.CreateDateFilterClause(
                    _propertyName, FilterClauseOperator.OpGreaterThanOrEqualTo, date);
                IFilterClause endClause = filterClauseFactory.CreateDateFilterClause(
                    _propertyName, FilterClauseOperator.OpLessThan, date.AddDays(1));
                return(filterClauseFactory.CreateCompositeFilterClause(
                           startClause, FilterClauseCompositeOperator.OpAnd, endClause));
            }
            return(filterClauseFactory.CreateDateFilterClause(_propertyName, _filterClauseOperator, date));
        }
예제 #23
0
        public virtual void TestWinApplyFilterFiresFilterUpdatedEvent()
        {
            //---------------Set up test pack-------------------
            BusinessObjectCollection <MyBO> col;
            GridBaseWin          gridBase     = (GridBaseWin)GetGridBaseWith_4_Rows(out col).GetControl();
            string               filterString = col[2].ID.ToString().Substring(5, 30);
            IFilterClauseFactory factory      = new DataViewFilterClauseFactory();
            IFilterClause        filterClause =
                factory.CreateStringFilterClause(_gridIdColumnName, FilterClauseOperator.OpLike, filterString);
            bool filterUpdatedFired = false;

            gridBase.FilterUpdated += delegate { filterUpdatedFired = true; };
            //---------------Execute Test ----------------------
            gridBase.ApplyFilter(filterClause);
            //---------------Test Result -----------------------
            Assert.IsTrue(filterUpdatedFired);
        }
예제 #24
0
        ///<summary>
        /// Returns the filter clause for this control
        ///</summary>
        ///<param name="filterClauseFactory"></param>
        ///<returns></returns>
        public IFilterClause GetFilterClause(IFilterClauseFactory filterClauseFactory)
        {
            string filterValue = _textBox.Text;

            if (String.IsNullOrEmpty(filterValue))
            {
                return(filterClauseFactory.CreateNullFilterClause());
            }
            IFilterClause currentClause = filterClauseFactory.CreateStringFilterClause(_propertyNames[0], _filterClauseOperator, filterValue);

            for (int i = 1; i < _propertyNames.Count; i++)
            {
                IFilterClause rightClause = filterClauseFactory.CreateStringFilterClause(_propertyNames[i], _filterClauseOperator, filterValue);
                currentClause = filterClauseFactory.CreateCompositeFilterClause(currentClause, FilterClauseCompositeOperator.OpOr, rightClause);
            }
            return(currentClause);
        }
예제 #25
0
        public void TestFilterClause()
        {
            //---------------Set up test pack-------------------
            _testBuilder.Operator = FilterClauseOperator.OpGreaterThan;
            _testBuilder.UsingEnumTypeConstructor = true;
            var filter   = _testBuilder.CreateInstance();
            var comboBox = (IComboBox)filter.Control;
            var text     = Convert.ToString(PurchaseOrderStatus.Processed);

            comboBox.Text          = text;
            comboBox.SelectedIndex = 2;
            //---------------Execute Test ----------------------
            IFilterClause filterClause = filter.GetFilterClause(new DataViewFilterClauseFactory());

            //---------------Test Result -----------------------
            Assert.AreEqual(string.Format("{0} > '{1}'", _testBuilder.PropertyName, PurchaseOrderStatus.Processed), filterClause.GetFilterClauseString());
        }
예제 #26
0
        ///<summary>
        /// Returns the filter clause for this control
        ///</summary>
        ///<param name="filterClauseFactory"></param>
        ///<returns></returns>
        public IFilterClause GetFilterClause(IFilterClauseFactory filterClauseFactory)
        {
            if (_dateRangeComboBox.SelectedIndex > 0)
            {
                FilterClauseOperator op          = _includeStartDate ? FilterClauseOperator.OpGreaterThanOrEqualTo : FilterClauseOperator.OpGreaterThan;
                IFilterClause        startClause = filterClauseFactory.CreateDateFilterClause(_propertyName, op, _dateRangeComboBox.StartDate);
                op = _includeEndDate
                    ? FilterClauseOperator.OpLessThanOrEqualTo
                    : FilterClauseOperator.OpLessThan;
                IFilterClause endClause = filterClauseFactory.CreateDateFilterClause(_propertyName, op, _dateRangeComboBox.EndDate);

                return
                    (filterClauseFactory.CreateCompositeFilterClause(startClause, FilterClauseCompositeOperator.OpAnd,
                                                                     endClause));
            }
            return(filterClauseFactory.CreateNullFilterClause());
        }
예제 #27
0
        public void TestAddDateFilterDateTimePicker_DefaultDateCorrect()
        {
            //---------------Set up test pack-------------------
            IControlFactory      factory             = GetControlFactory();
            IFilterClauseFactory filterClauseFactory = new DataViewFilterClauseFactory();
            IFilterControl       filterControl       = factory.CreateFilterControl();
            DateTime             testDate            = DateTime.Today.AddDays(-2);

            //---------------Execute Test ----------------------
            filterControl.AddDateFilterDateTimePicker("test:", "TestColumn", testDate, FilterClauseOperator.OpGreaterThan, false);
            string expectedFilterClause = filterControl.GetFilterClause().GetFilterClauseString();
            //---------------Test Result -----------------------
            IFilterClause clause =
                filterClauseFactory.CreateDateFilterClause("TestColumn", FilterClauseOperator.OpGreaterThan, new DateTime(testDate.Year, testDate.Month, testDate.Day));

            Assert.AreEqual(clause.GetFilterClauseString(), expectedFilterClause);
            //---------------Tear Down -------------------------
        }
예제 #28
0
        /// <summary>
        /// See <see cref="IFilterControl.GetFilterClause"/>
        /// </summary>
        public IFilterClause GetFilterClause()
        {
            if (_filterControls.Count == 0)
            {
                return(_clauseFactory.CreateNullFilterClause());
            }
            ICustomFilter filterUi = _filterControls[0];
            IFilterClause clause   = filterUi.GetFilterClause(_clauseFactory);

            for (int i = 1; i < _filterControls.Count; i++)
            {
                filterUi = _filterControls[i];
                clause   =
                    _clauseFactory.CreateCompositeFilterClause(clause, FilterClauseCompositeOperator.OpAnd,
                                                               filterUi.GetFilterClause(_clauseFactory));
            }
            return(clause);
        }
        public void Test_Filter_CompositeEqualsWithAnd()
        {
            //---------------Set up test pack-------------------

            IFilterClause clause1 =
                filterClauseFactory.CreateStringFilterClause("h a", FilterClauseOperator.OpLike, "Peter");
            IFilterClause clause2 =
                filterClauseFactory.CreateStringFilterClause("h a", FilterClauseOperator.OpLike, "Kelly");
            IFilterClause compositeClause =
                filterClauseFactory.CreateCompositeFilterClause(clause1, FilterClauseCompositeOperator.OpAnd, clause2);

            //---------------Execute Test ----------------------

            string expectedFilterString = compositeClause.GetFilterClauseString();

            //---------------Test Result -----------------------
            Assert.AreEqual("([h a] like '*Peter*') and ([h a] like '*Kelly*')", expectedFilterString);
        }
예제 #30
0
        public void Test_Construct_WhenFilterValueSet_ShouldReturnStringFilterClause()
        {
            //---------------Set up test pack-------------------
            string propertyName = TestUtil.GetRandomString();
            const FilterClauseOperator filterClauseOperator = FilterClauseOperator.OpGreaterThan;
            const string filterValue = "constantValue";
            //---------------Execute Test ----------------------
            StringStaticFilter filter = new StringStaticFilter(propertyName, filterClauseOperator, filterValue);

            //---------------Test Result -----------------------
            Assert.IsNull(filter.Control);
            Assert.AreEqual(propertyName, filter.PropertyName);
            Assert.AreEqual(filterClauseOperator, filter.FilterClauseOperator);

            IFilterClause filterClause = filter.GetFilterClause(new DataViewFilterClauseFactory());

            Assert.IsInstanceOf <DataViewStringFilterClause>(filterClause);
        }
        public void TestGetTextBoxFilterClause_Equals()
        {
            //---------------Set up test pack-------------------
            IFilterClauseFactory itsFilterClauseFactory = new DataViewFilterClauseFactory();
            IFilterControl       filterControl          = GetControlFactory().CreateFilterControl();
            ITextBox             tb = filterControl.AddStringFilterTextBox("Test:", "TestColumn", FilterClauseOperator.OpEquals);

            //---------------Execute Test ----------------------
            tb.Text = "testvalue";
            string filterClauseString = filterControl.GetFilterClause().GetFilterClauseString();

            //---------------Test Result -----------------------
            IFilterClause clause =
                itsFilterClauseFactory.CreateStringFilterClause("TestColumn", FilterClauseOperator.OpEquals, "testvalue");

            Assert.AreEqual(clause.GetFilterClauseString(), filterClauseString);

            //---------------Tear Down -------------------------
        }
예제 #32
0
 /// <summary>
 /// Applies a search clause to the underlying collection and reloads the grid.
 /// The search allows you to determine which objects to display using
 /// some criteria.  This is typically generated by the an <see cref="IFilterControl"/>.
 /// </summary>
 /// <param name="searchClause">The search clause</param>
 /// <param name="orderBy"></param>
 public void ApplySearch(IFilterClause searchClause, string orderBy)
 {
     this.GridBaseManager.ApplySearch(searchClause, orderBy);
 }
예제 #33
0
 /// <summary>
 /// Applies a filter clause to the data table and updates the filter.
 /// The filter allows you to determine which objects to display using
 /// some criteria.  This is typically generated by an <see cref="IFilterControl"/>.
 /// </summary>
 /// <param name="filterClause">The filter clause</param>
 public void ApplyFilter(IFilterClause filterClause)
 {
     GridBaseManager.ApplyFilter(filterClause);
 }
예제 #34
0
 /// <summary>
 /// Applies a search clause to the underlying collection and reloads the grid.
 /// The search allows you to determine which objects to display using
 /// some criteria.  This is typically generated by the an <see cref="IFilterControl"/>.
 /// </summary>
 /// <param name="searchClause">The search clause</param>
 /// <param name="orderBy"></param>
 public void ApplySearch(IFilterClause searchClause, string orderBy)
 {
     string filterClauseString = searchClause.GetFilterClauseString("%", "'");
     ApplySearch(filterClauseString, orderBy);
 }
예제 #35
0
        /// <summary>
        /// See <see cref="IGridBase.ApplyFilter"/>
        /// </summary>
        public void ApplyFilter(IFilterClause filterClause)
        {
            var bindingList = _gridBase.DataSource as IBindingListView;
            if (bindingList == null)
            {
                throw new GridBaseInitialiseException
                    ("You cannot apply filters as the grid DataSource has not been set with a IBindingListView");
            }
            var filterClauseString = filterClause != null ? filterClause.GetFilterClauseString("%", "#") : null;

            try
            {
                bindingList.Filter = filterClauseString;
            }
            catch (Exception e)
            {
                throw new HabaneroApplicationException(
                    e.Message + Environment.NewLine +
                    "An Error Occured while trying to Filter the grid with filterClause '" +
                    filterClauseString + "'", e);
            }
        }
 /// <summary>
 /// Creates a new composite filter clause combining two given filter
 /// clauses the operator provided
 /// </summary>
 /// <param name="leftClause">The left filter clause</param>
 /// <param name="compositeOperator">The composite operator, such as
 /// "and" or "or"</param>
 /// <param name="rightClause">The right filter clause</param>
 /// <returns>Returns the new filter clause object</returns>
 public IFilterClause CreateCompositeFilterClause(IFilterClause leftClause,
                                                  FilterClauseCompositeOperator compositeOperator,
                                                  IFilterClause rightClause)
 {
     return new DataViewCompositeFilterClause(leftClause, compositeOperator, rightClause);
 }
 /// <summary>
 /// Applies a filter clause to the data table and updates the filter.
 /// The filter allows you to determine which objects to display using
 /// some criteria.  This is typically generated by an <see cref="IFilterControl"/>.
 /// </summary>
 /// <param name="filterClause">The filter clause</param>
 public void ApplyFilter(IFilterClause filterClause)
 {
     this.GridBaseManager.ApplyFilter(filterClause);
     FireFilterUpdated();
 }