0

I filled the datasource of a control and then try to apply the filter. But after applying filter, it updates the datasource of the binding source to 0.

 private void SetFilterIntoBindingNavigator()
    {
        try
        {
            if (string.IsNullOrEmpty(this.FilterQuery.ToString()) || this.IsResetFilter)
                this.bindingNavigator1.BindingSource.RemoveFilter();
            else
                this.bindingNavigator1.BindingSource.Filter = this.FilterQuery.ToString();
        }
        catch (Exception ex)
        {
        }
    }

Why ?

user2691432
  • 93
  • 1
  • 2
  • 10
  • You expect to have at least some records in `BindingSource` after applying filter, don't you? Are you sure that `FilterQuery` should keep at least 1 record in your `BindingSource`? – King King Oct 04 '13 at 12:47
  • records are not coming for any value(present in the bindingNavigator1.BindingSource) of FilterQuery. It always sets the datasource of bindingNavigator1.BindingSource to 0. – user2691432 Oct 04 '13 at 13:08
  • it don't understand why it is setting datasource to 0 for matching values? – user2691432 Oct 04 '13 at 13:26

0 Answers0