GrapeCity.Xaml.SpreadSheet.UI
Search(Int32,Int32,String,SearchFlags,SearchOrder,SearchFoundFlags,SheetArea,Int32,Int32,Int32,Int32,Int32,Int32,Int32,String) Method
Example 


GrapeCity.Xaml.SpreadSheet.UI Namespace > GcSpreadSheet Class > Search Method : Search(Int32,Int32,String,SearchFlags,SearchOrder,SearchFoundFlags,SheetArea,Int32,Int32,Int32,Int32,Int32,Int32,Int32,String) Method
Index of the sheet on which to start the search.
Index of the sheet on which to end the search.
The string for which to search.
The GrapeCity.Xaml.SpreadSheet.Data.SearchFlags enumeration that specifies the search options.
The GrapeCity.Xaml.SpreadSheet.Data.SearchFlags enumeration that specifies whether the search goes by column, row coordinates or row, column coordinates.
The GrapeCity.Xaml.SpreadSheet.Data.SearchFoundFlags enumeration that indicates whether the search includes the content in the cell notes, tags, or text.
The area of the sheet to search.
The row index at which to start.
The column index at which to start.
The row index at which to stop searching.
The column index at which to stop searching.
The index of the sheet at which a match is found.
The index of the row at which a match is found.
The index of the column at which a match is found.
The found string.
Searches the text in the cells in the specified sheet for the specified string with the specified criteria and start and end location, and whether to search notes and tags as well.
Syntax
'Declaration
 
Public Overloads Function Search( _
   ByVal startSheetIndex As Integer, _
   ByVal endSheetIndex As Integer, _
   ByVal searchString As String, _
   ByVal searchFlags As SearchFlags, _
   ByVal searchOrder As SearchOrder, _
   ByVal searchTarget As SearchFoundFlags, _
   ByVal sheetArea As SheetArea, _
   ByVal rowStart As Integer, _
   ByVal columnStart As Integer, _
   ByVal rowEnd As Integer, _
   ByVal columnEnd As Integer, _
   ByRef foundSheetIndex As Integer, _
   ByRef foundRowIndex As Integer, _
   ByRef foundColumnIndex As Integer, _
   ByRef foundString As String _
) As SearchFoundFlags
'Usage
 
Dim instance As GcSpreadSheet
Dim startSheetIndex As Integer
Dim endSheetIndex As Integer
Dim searchString As String
Dim searchFlags As SearchFlags
Dim searchOrder As SearchOrder
Dim searchTarget As SearchFoundFlags
Dim sheetArea As SheetArea
Dim rowStart As Integer
Dim columnStart As Integer
Dim rowEnd As Integer
Dim columnEnd As Integer
Dim foundSheetIndex As Integer
Dim foundRowIndex As Integer
Dim foundColumnIndex As Integer
Dim foundString As String
Dim value As SearchFoundFlags
 
value = instance.Search(startSheetIndex, endSheetIndex, searchString, searchFlags, searchOrder, searchTarget, sheetArea, rowStart, columnStart, rowEnd, columnEnd, foundSheetIndex, foundRowIndex, foundColumnIndex, foundString)

Parameters

startSheetIndex
Index of the sheet on which to start the search.
endSheetIndex
Index of the sheet on which to end the search.
searchString
The string for which to search.
searchFlags
The GrapeCity.Xaml.SpreadSheet.Data.SearchFlags enumeration that specifies the search options.
searchOrder
The GrapeCity.Xaml.SpreadSheet.Data.SearchFlags enumeration that specifies whether the search goes by column, row coordinates or row, column coordinates.
searchTarget
The GrapeCity.Xaml.SpreadSheet.Data.SearchFoundFlags enumeration that indicates whether the search includes the content in the cell notes, tags, or text.
sheetArea
The area of the sheet to search.
rowStart
The row index at which to start.
columnStart
The column index at which to start.
rowEnd
The row index at which to stop searching.
columnEnd
The column index at which to stop searching.
foundSheetIndex
The index of the sheet at which a match is found.
foundRowIndex
The index of the row at which a match is found.
foundColumnIndex
The index of the column at which a match is found.
foundString
The found string.

Return Value

A GrapeCity.Xaml.SpreadSheet.Data.SearchFoundFlags enumeration that specifies what is matched.
Example
This example uses the Search method.
gcSpreadSheet1.Sheets[0].Cells[5, 4].Text = "test";                      

private void Button_Click_1(object sender, RoutedEventArgs e)
        {
int colfound;
int rowfound;
int sheetfound;
string foundstring;
colfound = 0;
rowfound = 0;
sheetfound = 0;
gcSpreadSheet1.SheetCount = 2;
//gcSpreadSheet1.Search(0, "test", out rowfound, out colfound);
//gcSpreadSheet1.Search(0, "test", GrapeCity.Xaml.SpreadSheet.Data.SearchFlags.ExactMatch, out rowfound, out colfound);
//gcSpreadSheet1.Search(0, "test", GrapeCity.Xaml.SpreadSheet.Data.SearchFlags.ExactMatch, GrapeCity.Xaml.SpreadSheet.Data.SearchOrder.ZOrder, out rowfound, out colfound);
//gcSpreadSheet1.Search(0, "test", GrapeCity.Xaml.SpreadSheet.Data.SearchFlags.ExactMatch, GrapeCity.Xaml.SpreadSheet.Data.SearchOrder.ZOrder, GrapeCity.Xaml.SpreadSheet.Data.SearchFoundFlags.CellText, out rowfound, out colfound);
//gcSpreadSheet1.Search(0, "test", GrapeCity.Xaml.SpreadSheet.Data.SearchFlags.ExactMatch, GrapeCity.Xaml.SpreadSheet.Data.SearchOrder.ZOrder, GrapeCity.Xaml.SpreadSheet.Data.SearchFoundFlags.CellText, GrapeCity.Xaml.SpreadSheet.Data.SheetArea.Cells, out rowfound, out colfound);
//gcSpreadSheet1.Search(0, "test", GrapeCity.Xaml.SpreadSheet.Data.SearchFlags.ExactMatch, GrapeCity.Xaml.SpreadSheet.Data.SearchOrder.ZOrder, GrapeCity.Xaml.SpreadSheet.Data.SearchFoundFlags.CellText, GrapeCity.Xaml.SpreadSheet.Data.SheetArea.Cells, 0, 0, out rowfound, out colfound);
//gcSpreadSheet1.Search(0, "test", GrapeCity.Xaml.SpreadSheet.Data.SearchFlags.ExactMatch, GrapeCity.Xaml.SpreadSheet.Data.SearchOrder.ZOrder, GrapeCity.Xaml.SpreadSheet.Data.SearchFoundFlags.CellText, GrapeCity.Xaml.SpreadSheet.Data.SheetArea.Cells, 0, 0, 7, 7, out rowfound, out colfound);
//gcSpreadSheet1.Search(0, 1, "test", GrapeCity.Xaml.SpreadSheet.Data.SearchFlags.ExactMatch, GrapeCity.Xaml.SpreadSheet.Data.SearchOrder.ZOrder, GrapeCity.Xaml.SpreadSheet.Data.SearchFoundFlags.CellText, GrapeCity.Xaml.SpreadSheet.Data.SheetArea.Cells, 0, 0, 7, 7, out sheetfound, out rowfound, out colfound);
gcSpreadSheet1.Search(0, 0, "test", GrapeCity.Xaml.SpreadSheet.Data.SearchFlags.ExactMatch, GrapeCity.Xaml.SpreadSheet.Data.SearchOrder.ZOrder, GrapeCity.Xaml.SpreadSheet.Data.SearchFoundFlags.CellText, GrapeCity.Xaml.SpreadSheet.Data.SheetArea.Cells, 0, 0, 7, 7, out sheetfound, out rowfound, out colfound, out foundstring);
listBox1.Items.Add(colfound.ToString());                     
        }
GcSpreadSheet1.Sheets(0).Cells(5, 4).Text = "test"

Private Sub Button_Click_1(sender As Object, e As RoutedEventArgs)
        Dim colfound As Integer
        Dim rowfound As Integer
        Dim sheetfound As Integer
        Dim foundstring As String
        colfound = 0
        rowfound = 0
        sheetfound = 0
        foundstring = ""
        gcSpreadSheet1.SheetCount = 2
        'GcSpreadSheet1.Search(0, "test", rowfound, colfound)
        'GcSpreadSheet1.Search(0, "test", GrapeCity.Xaml.SpreadSheet.Data.SearchFlags.ExactMatch, rowfound, colfound)
        'GcSpreadSheet1.Search(0, "test", GrapeCity.Xaml.SpreadSheet.Data.SearchFlags.ExactMatch, GrapeCity.Xaml.SpreadSheet.Data.SearchOrder.ZOrder, rowfound, colfound)
        'GcSpreadSheet1.Search(0, "test", GrapeCity.Xaml.SpreadSheet.Data.SearchFlags.ExactMatch, GrapeCity.Xaml.SpreadSheet.Data.SearchOrder.ZOrder, GrapeCity.Xaml.SpreadSheet.Data.SearchFoundFlags.CellText, rowfound, colfound)
        'GcSpreadSheet1.Search(0, "test", GrapeCity.Xaml.SpreadSheet.Data.SearchFlags.ExactMatch, GrapeCity.Xaml.SpreadSheet.Data.SearchOrder.ZOrder, GrapeCity.Xaml.SpreadSheet.Data.SearchFoundFlags.CellText, GrapeCity.Xaml.SpreadSheet.Data.SheetArea.Cells, rowfound, colfound)
        'GcSpreadSheet1.Search(0, "test", GrapeCity.Xaml.SpreadSheet.Data.SearchFlags.ExactMatch, GrapeCity.Xaml.SpreadSheet.Data.SearchOrder.ZOrder, GrapeCity.Xaml.SpreadSheet.Data.SearchFoundFlags.CellText, GrapeCity.Xaml.SpreadSheet.Data.SheetArea.Cells, 0, 0, rowfound, colfound)
        'GcSpreadSheet1.Search(0, "test", GrapeCity.Xaml.SpreadSheet.Data.SearchFlags.ExactMatch, GrapeCity.Xaml.SpreadSheet.Data.SearchOrder.ZOrder, GrapeCity.Xaml.SpreadSheet.Data.SearchFoundFlags.CellText, GrapeCity.Xaml.SpreadSheet.Data.SheetArea.Cells, 0, 0, 7, 7, rowfound, colfound)
        'GcSpreadSheet1.Search(0, 1, "test", GrapeCity.Xaml.SpreadSheet.Data.SearchFlags.ExactMatch, GrapeCity.Xaml.SpreadSheet.Data.SearchOrder.ZOrder, GrapeCity.Xaml.SpreadSheet.Data.SearchFoundFlags.CellText, GrapeCity.Xaml.SpreadSheet.Data.SheetArea.Cells, 0, 0, 7, 7, sheetfound, rowfound, colfound)
        gcSpreadSheet1.Search(0, 0, "test", GrapeCity.Xaml.SpreadSheet.Data.SearchFlags.ExactMatch, GrapeCity.Xaml.SpreadSheet.Data.SearchOrder.ZOrder, GrapeCity.Xaml.SpreadSheet.Data.SearchFoundFlags.CellText, GrapeCity.Xaml.SpreadSheet.Data.SheetArea.Cells, 0, 0, 7, 7, sheetfound, rowfound, colfound, foundstring)
        ListBox1.Items.Add(colfound.ToString())
    End Sub
See Also

Reference

GcSpreadSheet Class
GcSpreadSheet Members
Overload List