PdcDataGrid

From External Bemet Wiki
Jump to: navigation, search

Methods[edit]

PdcDataGrid.FirstRecord
PdcDataGrid.GetField
PdcDataGrid.GetFile
PdcDataGrid.GetImage
PdcDataGrid.LastRecord
PdcDataGrid.Locate
PdcDataGrid.NextRecord
PdcDataGrid.PriorRecord
PdcDataGrid.RecordCount

Properties[edit]

PdcDataGrid.BoF
PdcDataGrid.EoF
PdcDataGrid.FieldNames
PdcDataGrid.GridName
PdcDataGrid.SelectedValues
PdcDataGrid.SelectionKey
PdcDataGrid.TableName

Notes[edit]

This property returns the active datagrid in the active window.

Code example[edit]

This code example loops trough the records in the grid and shows wheter or not they are selected.

Sub SelectieTest
dim activegrid
dim inttel
dim geselecteerd

  if pdc.Windows.ActiveWindow.WindowKey = "PB" then
    set activegrid = pdc.Windows.ActiveWindow.Datagrids.GetGridByName("PDCGrid1", "PR_POS")
    if IsValid(activegrid) then

      activegrid.FirstRecord
      do while not activegrid.EoF
        geselecteerd = false
        for inttel= 0 to activegrid.selectedValues.Count -1
          if activegrid.SelectedValues.Item(inttel) = activegrid.GetField(activegrid.SelectionKey) then
            geselecteerd = true
            exit for
          end if
        Next

        if geselecteerd then
          msgbox "Regel " & activegrid.GetField("PR_POS") & " is geselecteerd."
        else
          msgbox "Regel " & activegrid.GetField("PR_POS") & " is niet geselecteerd."
        end if
        activegrid.NextRecord
      loop
    end if
    set activegrid = nothing
  end if
End Sub

Availability[edit]

Available since April 2010 (from version 4.1)