To search for data in any of the cells of a sheet, use any of these sets of methods in the FpSpread class:
- Search methods
- SearchHeaders methods
- SearchWithDialog methods
- SearchWithDialogAdvanced methods
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. For a list of qualifications (restrictions) of the search, refer to the set of methods listed above for more details.
Most searches (besides the method that specifies a block range of cells) start at the specified start cell and continue to the end of the row and then start the next row at the first cell. The search continues until either the end cell or the end of the sheet.
For information about the search dialog, refer to Allowing the User to Perform a Standard Search.
Return to the overview at Customizing User Searching of Data.
Using Code
Use the Search method for the Spread component 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.
Example
C# | Copy Code |
---|---|
fpSpread1.Search(2,"Total",true,true,false,false,1,1,56,56, ref rowindx,ref colindx)); |
VB | Copy Code |
---|---|
FpSpread1.Search(2,"Total",True,True,False,False,1,1,56,56, ref rowindx,ref colindx)) |