The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I modified an example that I found to the following... The problem is that if I set the grid to start at position 0,)
gridRangeInfo(0,Column)
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
With dg
.ForceCurrentCellMoveTo = True
.CurrentCell.MoveTo(1, iColumn)
End With
frLocationInfo = GridRangeInfo.Cell(1, iColumn)
fre = New GridFindReplaceEventArgs(Value, "", GridFindTextOptions.ColumnOnly, frLocationInfo)
If Not fr.Find(fre) Is Nothing Then
Return True
Else
Return False
End If
End Function
ADAdministrator Syncfusion Team October 17, 2003 01:05 PM UTC
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.