Skip to content

Grid rendering and row-click wiring

Provide a styled GridView with accessible markup and optional client-side row-click behavior. Control construction, Init, RowDataBound, and PreRender for a SAIFGrid instance.

Field Value
Operation ID OP-V2-013
Trigger Control construction, Init, RowDataBound, and PreRender for a SAIFGrid instance.
Inputs DataKeyField, bound data items.
Outputs Styled grid markup with an accessible header and, when configured, client-side row-click attributes.
Primary components SAIFGrid
Entry point SAIF.Presentation.Web.Controls.V2/SAIFGrid.vb

Steps

  1. On construction, set the CSS class to SAIFGrid. (BR-V2-081)
  2. On Init, register /Resources/Scripts/SAIF.Grid.js and a generated startup script block, each only once per page. (BR-V2-082)
  3. On RowDataBound, when DataKeyField is non-empty and the row is a data row, read that property from the bound item by reflection and emit it as the row's dataKeyField attribute. (BR-V2-083, BR-V2-084)
  4. On PreRender, when the grid has rows, enable the accessible header and move the header row into the <thead> table section. (BR-V2-085)

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start([Construction]) --> Css[Set SAIFGrid CSS class]
    Css --> Init[Init: register SAIF.Grid.js + startup script]
    Init --> RDB{RowDataBound}
    RDB --> Key{DataKeyField set?}
    Key -->|Yes| Reflect[Reflect key value, emit row attribute]
    Key -->|No| Skip[Skip row-click wiring]
    Reflect --> Pre[PreRender: accessible header, thead]
    Skip --> Pre
    Pre --> Done([Rendered])

Failure and edge-case behavior

  • No exceptional failure handling beyond the branches described in Steps was found in the analysis findings.*

Sources

  • SAIF.Presentation.Web.Controls.V2/SAIFGrid.vb