14
Views
3
Comments
Solved
[OutSystems Data Grid] Clear all checked rows/items
Question
outsystems-data-grid
Reactive icon
Forge asset by OutSystems
Application Type
Reactive

I'm trying to clear all checked rows in an OutSystems Data Grid after applying a filter. To clarify, I'm not referring to selected rows, but to rows that have been checked using a checkbox column.

My first implementation was based on the selection APIs (GetSelectedRowsData, SetRowAsSelected, etc.), but this doesn't work reliably when filtering is involved. Not all rows are returned, and some rows remain checked after the action.

I found the GetCheckedRowsData function, which allows me to retrieve the data of the checked rows, but I cannot find an equivalent API that returns the actual row numbers or row identifiers, similar to how the selection APIs work. Without that, I don't see an easy way to programmatically uncheck all checked rows. Has anyone solved this before, or does anyone have suggestions on how to clear all checked rows after filtering?

2026-01-28 16-57-48
Mihai Melencu
Champion
Solution

Hi @Luuk van Laarhoven ,

You can use the following JavaScript in the button’s logic: 

  1. var grid = OutSystems.GridAPI.GridManager.GetGridById($parameters.GridWidgetId);

  2. var checkedRows = grid.provider.selectedItems || [];

  3. for (var i = 0; i < checkedRows.length; i++) {
  4.     if (checkedRows[i].__osRowMetadata) {
  5.         checkedRows[i].__osRowMetadata.delete("__rowSelection");
  6.     }
  7. }

  8. grid.provider.refresh();
2026-06-26 15-03-49
Rammurthy Naidu Boddu
Champion
Solution

Hi 

First option : Use GetAllCheckedRows. 
Second option :
Use java script 
let grid = GridAPI.GridManager.GetGridById($parameters.GridWidgetId);

grid.provider.rows.forEach(function(row) {
    row.isSelected = false;
});

grid.provider.refresh(); 

2026-01-28 16-57-48
Mihai Melencu
Champion
Solution

Hi @Luuk van Laarhoven ,

You can use the following JavaScript in the button’s logic: 

  1. var grid = OutSystems.GridAPI.GridManager.GetGridById($parameters.GridWidgetId);

  2. var checkedRows = grid.provider.selectedItems || [];

  3. for (var i = 0; i < checkedRows.length; i++) {
  4.     if (checkedRows[i].__osRowMetadata) {
  5.         checkedRows[i].__osRowMetadata.delete("__rowSelection");
  6.     }
  7. }

  8. grid.provider.refresh();
2026-06-26 15-03-49
Rammurthy Naidu Boddu
Champion
Solution

Hi 

First option : Use GetAllCheckedRows. 
Second option :
Use java script 
let grid = GridAPI.GridManager.GetGridById($parameters.GridWidgetId);

grid.provider.rows.forEach(function(row) {
    row.isSelected = false;
});

grid.provider.refresh(); 

2023-07-11 07-39-05
Luuk van Laarhoven

Thanks for your response, @Rammurthy Naidu Boddu  & @Mihai Melencu. I agree that working with the selected items is the best approach. Unfortunately, after applying a filter, rows that were previously checked but no longer match the filter criteria remain selected internally. Because of that, relying on the selected items does not fully solve the problem. It would be great to have an API action that returns all checked items, regardless of the current filter state. At the moment, it seems only the underlying data can be retrieved. My current workaround is to clear the row metadata for all rows. It's not an ideal solution, but functionally it achieves the result I need.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.