Friday, July 04, 2008  



 FarPoint Technologies
 (800) 645-5913

 fpsales@fpoint.com



     
 »Spread for Windows Forms » Product Tour » User Interaction » Search

Previous Customizing User Searching of Data Next

You can search for data in any of the cells in the workbook by specifying the sheet and the string of data for which to search.

  Back to Top
 Allowing the User to Perform a Standard Search
You can pop-up a search (find) dialog for the end-user to allow them to search the text of cells in a sheet for a particular string of text. You can display a default search string in the 'Find what' combo box and search using the following options:
  • Match case - finding only strings that match the case of the search string (upper or lower case).
  • Match exactly - finding only string that match the search string exactly.
  • Alternate search - searching down rows across columns rather than vice versa.
  • Use wildcards - allow the use of wildcard characters in the search string.
Perform an exact-match search on the fourth sheet (Sheet 3) for the phrase "Not Available" and start at the first row and column:
// C#
fpSpread1.SearchWithDialog(3,"Not Available",true,true,false,false,0,0);

' VB
FpSpread1.SearchWithDialog(3,"Not Available",True,True,False,False,0,0)


  Back to Top
 Allowing the User to Perform an Advanced Search
You can also add some advanced options to the search dialog for the end-user to allow them to search other areas of the spreadsheet, including cell notes and header text. The advanced options include:
  • Include headers- this extends the search to include all the row and column header cells.
  • Include cell tags- this extends the search to include all the cell tags in the data area.
  • Include cell notes- this extends the search to include all the cell notes in the data area.
// C#
fpSpread1.SearchWithDialogAdvanced(0,4,"This",true,true,false,false,0,0);

' VB
FpSpread1.SearchWithDialogAdvanced(0,4,"This",True,True,False,False,0,0)


  Back to Top
 Searching for Data with Code
To search for data in any of the cells of a sheet, use the Search methods or the SearchWithDialog methods in the FpSpread class. The parameters of the various search methods allow you to specify the sheet to search, the string for which to search, and the matching criteria.

Use the Search method for the FpSpread control to perform an exact-match search on the third sheet (Sheet 2) for the word "Total" and return the values of the row index and column index of the found cell:
// C#
fpSpread1.Search(2,"Total",true,true,false,false,1,1,56,56,ref rowindex,ref colindex));

' VB
FpSpread1.Search(2,"Total",True,True,False,False,1,1,56,56,ref rowindex,ref colindex))



Previous Customizing User Searching of Data Next

    
 Have a question?
Have a Question? Ask Us!
Subscribe to the RSS feed!RSS Subscribe
 

 
SD Times 'TOP 100' Industry Innovator - Read the press release (pdf)

Tour Home
Overview
Appearance
User Interaction
Cell Types
Formulas
Managing Data
Data Binding
Import/Export
Printing
Keyboard Interaction
Shapes
Models
Spread Designer
 
Map

Copyright © 1991-2007 FarPoint Technologies, Inc. All rights reserved. All names are property of their respective owners.