Reputation: 13620
In my XAML I've set up a grid and placed some buttons. One button for instance is placed in row 1, column 1. Given a event, I would like to move that button to column 0, and set the rowspan to 2.
How can I do that with C# in the code behind?
Upvotes: 1
Views: 286
Reputation: 28425
Assuming btn
is your button, add the following code in the event handler for your event:
btn.SetValue(Grid.ColumnProperty, 0)
btn.SetValue(Grid.RowSpan, 2)
Upvotes: 2