Spread Windows Forms 7.0 Product Documentation
Searching for Data with Code
Support Options
Spread Windows Forms 7.0 Product Documentation > Developer's Guide > Customizing Sheet Interaction > Customizing User Searching of Data > Searching for Data with Code

Glossary Item Box

To search for data in any of the cells of a sheet, use any of these sets of 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. 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.

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))

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.