The community will undergo maintenance on October 16th at 10:00 PM PDT and will be unavailable for up to one hour.
I've noticed that in TWX 9.5, a selected row is deselected when they are clicked on again. How can I prevent this? I don't want the row to be deselectable unless a different row is clicked on.
Solved! Go to Solution.
There is no direct way I know of.
What you can do though is to reselect the last selection when it gets unselected, because the SelectedRows property works in both directions.
so you bind SelectedRows as input and output of a "reselect" service which gets executed on RowsSelectionChanged.
The service does something like this:
if (!selRows||selRows.length==0) {
result=me.prevSelection;
} else {
me.prevSelection=selRows;
result=selRows;
}
With me.prevSelection being an Infotable property of the same Datashape as your grid.
For this to be scalable, this would have to be a session variable instead of a thing property so it supports multiple users, but you get the idea.
It flickers a bit, but it does the trick.
There is no direct way I know of.
What you can do though is to reselect the last selection when it gets unselected, because the SelectedRows property works in both directions.
so you bind SelectedRows as input and output of a "reselect" service which gets executed on RowsSelectionChanged.
The service does something like this:
if (!selRows||selRows.length==0) {
result=me.prevSelection;
} else {
me.prevSelection=selRows;
result=selRows;
}
With me.prevSelection being an Infotable property of the same Datashape as your grid.
For this to be scalable, this would have to be a session variable instead of a thing property so it supports multiple users, but you get the idea.
It flickers a bit, but it does the trick.