Private Sub FindData() Dim ColumnName As String Dim intGridPointer As Int64 'ColumnName = DataGrid1.TableStyles(0).GridColumnStyles(0).MappingName ColumnName = Me.dsDoctors.Doctors.DefaultView.Sort Dim drFounded() As DataRow If txtFind.Text.Trim <> "" Then 'drFounded = DirectCast(DataGrid1.DataSource, DataView).Table.Select(ColumnName & " Like '%" & txtFind.Text.ToUpper.Trim & "%'") drFounded = Me.dsDoctors.Tables(0).Select(ColumnName & " Like '%" & txtFind.Text.ToUpper.Trim & "%'") End If If drFounded.GetUpperBound(0) > 0 Then Me.dsDoctors.Doctors.DefaultView.Sort = ColumnName Dim strremove(1) As Char strremove(0) = "[" strremove(1) = "]" ColumnName.Trim(strremove) intGridPointer = Me.dsDoctors.Doctors.DefaultView.Find(drFounded(0).Item(ColumnName.Trim(strremove))) DataGrid1.CurrentRowIndex = intGridPointer End If End Sub