Login    
 
 
 
 
Text/HTML
  
You are here :: Blogs Saturday, May 19, 2012

Search
Note: This uses the internal blog search engine. The Google search engine is also available at the top of the page.
  
Disclaimer

Please review the site disclaimer before downloading or using content found on this site

  
Categories
  
DEVSHED Blog
As always, I welcome your comments!
Mar 31

Written by: Steve Gray
3/31/2010 2:35 PM  RssIcon

This piece of code will do a 'contains' filter on a Janus grid

This code will allow multiple filter conditions

Code Snippet
  1. Private Sub filter()
  2.     Dim colCustomerName As GridEXColumn
  3.     Dim colCustomerNumber As GridEXColumn
  4.     Dim strCustomerName As String = Me.txtCustomerName.Text
  5.     Dim strCustomerNumber As String = Me.txtCustomerNumber.Text
  6.  
  7.  
  8.     'Get a reference of the column to be compared
  9.     colCustomerName = GridEX1.RootTable.Columns("custname")
  10.     colCustomerNumber = GridEX1.RootTable.Columns("custnmbr")
  11.  
  12.  
  13.     'Create the condition
  14.     Dim condition As New GridEXFilterCondition
  15.     If strCustomerName > "" Then
  16.         condition.AddCondition(New GridEXFilterCondition(colCustomerName, ConditionOperator.Contains, strCustomerName))
  17.     End If
  18.  
  19.  
  20.     If strCustomerNumber > "" Then
  21.         condition.AddCondition(New GridEXFilterCondition(colCustomerNumber, ConditionOperator.Contains, strCustomerNumber))
  22.     End If
  23.  
  24.  
  25.     ''Assign the condition to the table to filter the records
  26.     If condition.Conditions.Count > 0 Then
  27.         GridEX1.RootTable.FilterCondition = condition
  28.     End If
  29. End Sub

Tags:
Categories:
As always, I welcome your comments!
  
 
 
Home | Products | Blogs | Contact Us | Links | God's Plan
Privacy Statement | Terms Of Use
 
Copyright 2011 by Devshed.us