Hey Everyone!
I have a business request to store selected rows (via checkbox) in the database. This also implies that when we load the page, the previously selected rows need to remain selected
I tried to select the rows with the new API (SetRowAsSelected) but it says that it doesn't work if the RowHeader property is set to "RowHeader.RowCheckbox" How do I do this?
Hello André!
If you follow this documentation by outsystems(How to save changes to the OutSystems Data Grid - OutSystems How to Guide), you will see that you can use the "GetChangedLines" and then Deserialize the results to get which lines changed on the datagrid.
If:
1. You send a structure to the datagrid with an IsSelected attribute, such as:
2. Map this IsSelected to a Checkbox column(Which you can find out how to do here)
3. Set this column as editable
You will be able to use the get changed lines to build your list of records that were selected/unselected.
As you said your selection needs to be persistent, than you will need to save this IsSelected attribute on the database, which you can also find how to do on that documentation.
Regards!
That doesn't really solve my issue. I need to use the default checkbox that comes with the Datagrid because I need the "Select All" checkbox in the header:
So if I use a Checkbox Column I won't have that option