While I'm trying to perform Search with the Default DataGridView Search Template, it throwing several same exceptions. The error message is given below:
The search works, but when it goes to end of the grid, it should show the default message. Instead it continues to search and throwing exceptions.
Any further help would be appreciated. Thank you.
Code Snippet from SearchGrid() function:
PowerShell Code
Double-click the code block to select all.if($cell.Value.ToString().IndexOf($seachString, [StringComparison]::OrdinalIgnoreCase) -ne -1) { $datagridviewDisplayADUserInfo.CurrentCell = $cell return }Error Message:
PowerShell Code
Double-click the code block to select all.ERROR: You cannot call a method on a null-valued expression. Display-ADUserInfo.pff (220): ERROR: At Line: 220 char: 7 ERROR: + if($cell.Value.ToString().IndexOf($seachString, [StringComparison]::OrdinalI ... ERROR: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ERROR: + CategoryInfo : InvalidOperation: (:) [], RuntimeException ERROR: + FullyQualifiedErrorId : InvokeMethodOnNull ERROR: