> For the complete documentation index, see [llms.txt](https://brixxbox.gitbook.io/brixxbox-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://brixxbox.gitbook.io/brixxbox-documentation/client-api-reference/functions/isrowselected.md).

# isRowSelected

Checks if a row in a grid is selected or not.

### Parameters

1. controlId - The id of the grid
2. line - This can be either a whole line from a "myGrid.allRows" call or a single id from a record.

### Example Usages

```javascript
   let result = brixxApi.isRowSelected("myGrid", myLine)
```

*Used in a loop*

```javascript
   let allRows = app.getFieldValue("myGrid.allRows");
   for(let i = 0; i < allRows.length; i++){
      if(brixxApi.isRowSelected("myGrid", allRows[i])){
         console.log("This is selected: " + line.id);
      }
   }
```

*Used with an id*

```
   let result = brixxApi.isRowSelected("myGrid", 123); //Checks if the line with the id 123 is selected.
```
