I have a grid in a xaml with 6 rows,each row is having a user control.
Now I want to interchange 3 and 4th row based on some condition dynamically.
Is it possible to do by binding a property to Grid.Row?
Could anyone please help me out as I'm unable to figure out as to how to implement this.
I created 6 textblocks and 1 button. On clicking button, it will alter row positions of textblock 3 and textblock 4.
You can put your user controls instead of textblocks.
Xaml:
Code behind:
Before clicking button:
After clicking button: It changed the positions of 3rd and 4th row.
Hope this helps.
UPDATE:
On button click: