Issue is that I have wrote a method to duplicate selected row in a grid.
Method likes (Grid is binded to my_query):
Namespace LightSwitchApplication
Public Class Assignacions_GR_a_DPT_o_IR_manuals
Private Sub Dup_row_Execute()
Dim mySelectedItem = Me.my_query.SelectedItem
Dim newItem = Me.my_query.AddNew()
newItem.someProperty_1 = mySelectedItem.someProperty_1
...
newItem.someProperty_n = mySelectedItem.someProperty_n
End Sub
End Class
End Namespace
All runs fine. But new row appears at the end of the grid insteat below selected item.
My question:
Is there a way to duplicated row appears just below source row?
I’m afraid not, that’s just the way it works. The only way that you could get the result you want (with the built-in grid) is to refresh the grid collection (in your case Me.my_uqery.Refresh).
There are a couple of things to note about that approach:
The SelectedItem probably won’t be the same (from memory it’ll be the first row)
The visual aspect of the refreshing may be disconcerting to users (then again, it may not)
I hope that helps.