cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

How to prevent deselection of a row in a grid

Willie
16-Pearl

How to prevent deselection of a row in a grid

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.

1 REPLY 1
Rocko
17-Peridot
(To:Willie)

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.

Top Tags