We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

FindRecordInGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

8043 Oct 17,2003 07:39 AM Oct 17,2003 09:05 AM Windows Forms 1
loading
Tags: GridControl
Jean-François Larente
Asked On October 17, 2003 07:39 AM

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

Administrator [Syncfusion]
Replied On October 17, 2003 09: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.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;