Skip to main content
1-Visitor
January 18, 2017
Solved

Maintain Selected Rows through refresh

  • January 18, 2017
  • 10 replies
  • 6844 views

I currently call a service to populate a table, but to make sure that I am displaying the latest values I have to refresh the grid.  Once I do this the selected/highlighted row is lost.

Is there a way to maintain the selected row even after a refresh?

Thanks,

Paul

Best answer by CarlesColl

Hi All,

The reason about it doesn't maintains the selected row it's becouse you don't have a Primary Key field on the DataShape, if you set a Primary Key field on the DataSet ( and of course it has a unique value ) the selected row will be maintained.

Carles.

10 replies

20-Turquoise
January 18, 2017

Off top of my had, you may try using an intermediate variable for storing "current selected row", and rebind upon the refresh?

pbaierl1-VisitorAuthor
1-Visitor
January 18, 2017

Thanks Polina,

I am kind of already doing something like this using expressions.  I am able to keep the grid from moving around during a refresh.  I have also setup methods to retain the selected value so that the data I want remains.  The problem is that I have received feedback from some of our testers that it isn't acceptable to loose the highlighted row being displayed.

Is there a way to rebind/select the previous value?  I already keep track of what it is/was.  I just don't know hot to plug it back into my service or the grid to get the highlighting around the selected row back.

It was requested that I mimic the functionality of a list or drop down where a selected key is passed back into the widget to select an item.

5-Regular Member
January 18, 2017

Paul Baierl​, As per my understanding the selected row cannot be rebind back to the Grid. Grid just allows AutoSelect first Row option and it does not have SelctedItems option like in list widget.

You might have to create your own custom Grid widget for this feature. You can use the Grid widget as base for your Custom widget.

I hope it helps.

Thanks,

Ankit Gupta

1-Visitor
January 18, 2017

Hi All,

The reason about it doesn't maintains the selected row it's becouse you don't have a Primary Key field on the DataShape, if you set a Primary Key field on the DataSet ( and of course it has a unique value ) the selected row will be maintained.

Carles.

5-Regular Member
January 18, 2017

I just tested and yes selected Row is maintained.

1-Visitor
January 18, 2017

You don't trust me