Custom Filter in Far Point Grid

Posted by: kamlesh on 8 September 2017, 3:10 pm EST

  • Posted 8 September 2017, 3:10 pm EST

    I am using Farpoint Version 5.0.3514.2008.  I want to apply filter on data rows. I had already derived a class from <font size="2" face="Consolas"><font size="2" face="Consolas"><p>FarPoint.Win.Spread.BaseFilterItem<p>Want to apply some filtering on page load itself.Don't want to show the filter list in column header.<p>fpSpread1.ActiveSheet.Columns[1].AllowAutoFilter = true<br>My filter expression can be based on multiple columns. i.e  I have three columns in grid Name,Age,Dept   then my expression could be "name != '' and Age>10"</p><p>Some thing like this</p></font></font><p><font color="#2b91af" size="2" face="Consolas"><font color="#2b91af" size="2" face="Consolas"><font color="#2b91af" size="2" face="Consolas"><font size="2" face="Consolas"><font size="2" face="Consolas"></font></font></font></font></font> </p><font color="#2b91af" size="2" face="Consolas"><font color="#2b91af" size="2" face="Consolas"><font color="#2b91af" size="2" face="Consolas"><font size="2" face="Consolas"><font size="2" face="Consolas"><p><br></p></font></font></font></font></font>
  • Replied 8 September 2017, 3:10 pm EST

    <div>           </div><div>Hello,</div><div> </div><div>After applying filtering, you need to set <span style="font-size:10pt;">ShowFilterIndicator property of the RowFilter to false in order to hide filter list in column header.</span></div><div> </div><div>            fpSpread1.ActiveSheet.Columns[3].AllowAutoFilter = true;</div><div>            fpSpread1.ActiveSheet.AutoFilterColumn(3, "14.00", 3);</div><div>            fpSpread1.ActiveSheet.RowFilter.ShowFilterIndicator = false;</div><div> </div><div>Hope it helps. </div><div> </div><div>Thanks,</div><div>Reeva </div>
  • Replied 8 September 2017, 3:10 pm EST

    <p>So this will work where my column value is 14. If want  not equal to 14 rest of the values displayed.What will be the expression</p><p>just like "Not Equal To 14" or <>14.  what will be the syntax.</p>
  • Replied 8 September 2017, 3:10 pm EST

    <p style="font-family:Tahoma, Arial, Helvetica;font-size:12px;">You need to create a custom filter  and use that in code. Code for the same is given below:-<br></p><p style="font-family:Tahoma, Arial, Helvetica;font-size:12px;">        FpSpread1.Sheets(0).Cells(0, 1).Value = 30<br>        FpSpread1.Sheets(0).Cells(1, 1).Value = 15<br>        FpSpread1.Sheets(0).Cells(2, 1).Value = 100<br>        Dim customfilter As New FarPoint.Win.Spread.CustomFilterItem(New FarPoint.Win.Spread.FilterCondition(FarPoint.Win.Spread.CustomFilterOperatorType.NotEqual, 100), Nothing, True)<br>        Dim rowFilter As New FarPoint.Win.Spread.HideRowFilter(FpSpread1.ActiveSheet)<br>        Dim fd As New FarPoint.Win.Spread.FilterColumnDefinition(1, FarPoint.Win.Spread.FilterListBehavior.Custom)<br>        fd.Filters.Add(customfilter)<br>        rowFilter.ColumnDefinitions.Add(fd)<br>        FpSpread1.ActiveSheet.RowFilter = rowFilter<br>        FpSpread1.ActiveSheet.AutoFilterColumn(1, customfilter.DisplayName, 0)</p><p style="font-family:Tahoma, Arial, Helvetica;font-size:12px;"> </p><p style="font-family:Tahoma, Arial, Helvetica;font-size:12px;">Else create a completely custom filter as shown in attached sample. </p><p style="font-family:Tahoma, Arial, Helvetica;font-size:12px;">Hope it helps.</p><p style="font-family:Tahoma, Arial, Helvetica;font-size:12px;">Thanks,</p><p style="font-family:Tahoma, Arial, Helvetica;font-size:12px;">Reeva</p>
    2013/08/CustomFilterNotEqualToValue.zip
Need extra support?

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

Learn More

Forum Channels