Skip to content

Instantly share code, notes, and snippets.

@NPS-ARCN-CAKN
Created August 23, 2019 17:13
Show Gist options
  • Save NPS-ARCN-CAKN/141e08b3b1c7ce69024429b1fc4db08a to your computer and use it in GitHub Desktop.
Save NPS-ARCN-CAKN/141e08b3b1c7ce69024429b1fc4db08a to your computer and use it in GitHub Desktop.
Function to return the current cell value of a GridEX
''' <summary>
''' Returns the value of GridEX's current cell, if it exists, otherwise an empty string.
''' </summary>
''' <param name="GridEX">GridEX</param>
''' <param name="ColumnName">Name of GridEX cell to interrogate.</param>
''' <returns>String</returns>
Private Function GetGridEXCellValue(GridEX As GridEX, ColumnName As String) As String
Dim CellValue As String = ""
'the gridex contains a column called FilesDirectory where the project's files are stored
'this sub will get the currently selected row in the GridEX, identify the FilesDirectory value
'and attempt to open the path using a process (file explorer, most likely)
Try
'get the current row of the VS GridEX
If Not GridEX.CurrentRow Is Nothing Then
If Not GridEX.CurrentRow.Cells(ColumnName) Is Nothing Then
CellValue = GridEX.CurrentRow.Cells(ColumnName).Value.ToString
End If
End If
Catch ex As Exception
MsgBox(ex.Message & " " & System.Reflection.MethodBase.GetCurrentMethod.Name)
End Try
Return CellValue
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment