I modified an example that I found to the following... The problem is that if I set the grid to start at position 0,)
It doesn't find anything in the grid.
However, if I set it to 1, it works, but only if there are 2 items in the grid.
What we're trying to do is when someone adds something to the grid, we look to see if it already exists before allowing it to happen.
Private Function FindRecordInGrid(ByVal Value As String, ByVal iColumn As Integer, ByVal dg As Syncfusion.Windows.Forms.Grid.GridDataBoundGrid) As Boolean
Dim fr As GridFindReplaceDialogSink = New GridFindReplaceDialogSink(dg)
Dim fre As GridFindReplaceEventArgs
Dim frLocationInfo As Object = Nothing
.ForceCurrentCellMoveTo = True
frLocationInfo = GridRangeInfo.Cell(1, iColumn)
fre = New GridFindReplaceEventArgs(Value, "", GridFindTextOptions.ColumnOnly, frLocationInfo)
If Not fr.Find(fre) Is Nothing Then
ADAdministrator Syncfusion Team October 17, 2003 08:05 AM
You can work around this problem by starting at the bottom and working up since the last row in the datagrid is the AddNew row. If you have turned off the AddNew row, you can still use it to work around the problem I think. Attached is a little sample.