Hi all,
I have got this strange behaviour. I have 2 Sharepoint lists and want to update both lists when a button is clicked. The first time it works as expected, but then the Gallery reverts to the first item, not the selecte one. I want the gallery to stay on the selected item. As I said: when I patch the second sharepoint list, my gallery reverts to the first item in the gallery. If I remove the second patch it stays on the correct selected item.
What am I doing wrong?
I hope someone can help me out. Listened all videos from @ShaneYoung, who saved me a lot of times. But this one is really interesting.
Regards, Kea
Solved! Go to Solution.
This is normal behaviour. The data source is changing so the gallery is refreshing changing the selected item to the first in the gallery not the one you previously selected.
What I do in this case is set the OnSelect in the gallery to store the item. Set(varRecord, ThisItem) then I use varRecord in place of Gallery.Selected. That way nothing changes. 🙂
I'm having a hard time understanding your scenario and the issue. I'm not sure what it is you're seeing when you say "the Gallery reverts to the first item, not the selected one". Is the selection changing? Are the contents of the gallery changing? What is in your gallery (Items property)? Maybe boil this down to a simpler case that illustrates the problem clearly.
This is normal behaviour. The data source is changing so the gallery is refreshing changing the selected item to the first in the gallery not the one you previously selected.
What I do in this case is set the OnSelect in the gallery to store the item. Set(varRecord, ThisItem) then I use varRecord in place of Gallery.Selected. That way nothing changes. 🙂
Thanks Shane!!! Keep up the good work.
User | Count |
---|---|
136 | |
127 | |
75 | |
72 | |
69 |
User | Count |
---|---|
222 | |
135 | |
78 | |
58 | |
54 |