Official Content

Selects an item in the Grid by giving its index value (starting at 1).

Syntax

<GridControlName>.Select(<index>)

Where:

GridControlName
     Is the name of the grid control or Tabular Grid Control.

index
     Is a Numeric expression (attribute, variable or constant value).

Scope

Controls: Grid controlTabular Grid control
Generators: Apple, Android, .NET, .NET Framework, JavaAngular

Notes:

  • If the index is out of the Grid's scope (i.e. larger value than the number of rows loaded), it will not have any effect. If the selected index's corresponding item is not visible, the content will scroll automatically so that the item is shown on the screen.

Notes for Grids in Panels:

  • Will not execute the default action associated with the Grid.
  • Will properly switch the default selected item layout.
  • In Apple, when the method is triggered, it will apply the Highlight Background Color property from the GridRow theme class.
    In Android, there is no user feedback when selection is done by code.
    In order to achieve the same behavior on both platforms, make sure that the Highlight Background Color property is empty.
  • When Grid control allows Multiple Selection, this method has different behaviors depending on the Show Selector property value. 
    • Always
      Will be accumulative.
    • On Action
      Won't be accumulative and the UI effect depends on Selection Type property value.

See Also

Grids with Selection By Code for Panels
SelectedItem property
SelectionChanged Event
Deselect method

 

Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant