Filters

Posted by: kpk on 8 September 2017, 1:26 pm EST

  • Posted 8 September 2017, 1:26 pm EST

    Can i apply filters to the child rows of a bound dataset?
  • Replied 8 September 2017, 1:26 pm EST

    The simplest way is the following...

    Private Sub FpSpread1_ChildViewCreated(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.ChildViewCreatedEventArgs) Handles FpSpread1.ChildViewCreated
    e.SheetView.Columns(0).AllowAutoFilter = True

    End Sub

  • Replied 8 September 2017, 1:26 pm EST

    Can I just set the filter programatically?  How do I do that?
  • Replied 8 September 2017, 1:26 pm EST

    Sure -

    Just set up the filters per the examples in the help file and apply them in the ChildViewCreated event

  • Replied 8 September 2017, 1:26 pm EST

    I don't see any examples in the help file.  I see this method on the shewview object which appears to be undocumented SetColumnFilterBy(int column, string text).  Using this method appears to have no effect.
  • Replied 8 September 2017, 1:26 pm EST

    <font class="keyword">Dim</font> instyle <font class="keyword">As</font> <font class="keyword">New</font>
    FarPoint.Win.Spread.NamedStyle
    <font class="keyword">Dim</font> outstyle <font class="keyword">As</font> <font class="keyword">New</font>
    FarPoint.Win.Spread.NamedStyle
    instyle.BackColor =
    Color.Yellow
    outstyle.BackColor = Color.Aquamarine
    <font class="keyword">Dim</font> fcd <font class="keyword">As</font> <font class="keyword">New</font> FarPoint.Win.Spread.FilterColumnDefinition(1,
    FarPoint.Win.Spread.FilterListBehavior.SortByMostOccurrences
    <font class="keyword">Or</font> FarPoint.Win.Spread.FilterListBehavior.Default)
    <font class="keyword">Dim</font> fcd1 <font class="keyword">As</font> <font class="keyword">New</font> FarPoint.Win.Spread.FilterColumnDefinition(2)
    <font class="keyword">Dim</font> fcd2 <font class="keyword">As</font> <font class="keyword">New</font> FarPoint.Win.Spread.FilterColumnDefinition

    <font class="keyword">Dim</font> sf <font class="keyword">As</font> <font class="keyword">New</font>
    FarPoint.Win.Spread.StyleRowFilter(fpSpread1.ActiveSheet, instyle,
    outstyle)
    sf.AddColumn(fcd)
    sf.AddColumn(fcd1)
    sf.AddColumn(fcd2)
    e.SheetView.RowFilter
    = sf
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels