Article Details
Id:11974
Product:finPOWER Connect
Type:NEW
Version:2.01.00
Opened:10/06/2014
Closed:12/06/2014
Released:27/06/2014
Job: J013419

Page Sets; Grids now supported Selected Rows functionality

Page Set Grids now support the following events:

  • AfterSelectedRowsChanged
    • Occurs when the row selection changes

Grid type Page Objects now have the following methods:

  • GetSelectedRowIndexes()
    • Returns an Integer array of selected row indexes
  • IsRowSelected(rowIndex)
    • Checks to see if the specified row is selected
  • SelectedRowsClear()
    • Clear row selection
  • SelectRow(rowIndex, selected)
    • Selects or deselects the specified row
  • SelectAllRows()
    • Select all rows
  • SelectRowsAbove()
    • Select all rows above and including the active row
  • SelectRowsBelow()
    • Select all rows below and including the active row

The following code sample shows each of these events and methods in use:

Public Sub btnTest_Click(sender As Object, e As finPageObjectClickEventArgs) Handles btnTest.Click

  'gridData.SelectedRowsClear()

  'gridData.SelectRow(3, Not gridData.IsRowSelected(3))

  'gridData.SelectRow

  'gridData.SelectAllRows()

  'gridData.SelectRowsUp()

  gridData.SelectRowsDown()

End Sub

Public Sub gridData_AfterSelectedRowsChanged(sender As Object, e As finPageObjectAfterSelectedRowsChangedEventArgs) Handles gridData.AfterSelectedRowsChanged

  Dim i As Integer
  Dim strTemp As String

  For Each i In gridData.GetSelectedRowIndexes()
    If Len(strTemp) <> 0 Then strTemp &= ","
    strTemp &= CStr(i)
  Next

  lblSelectedRows.Text = strTemp

End Sub