WPF Grid: Is there an easy way to readjust the row items if I need to insert new rows?

oscilatingcretin picture oscilatingcretin · May 19, 2011 · Viewed 13.2k times · Source

It appears that grid row and column definitions are hard-coded like this:

Grid.Row="3" Grid.Column="1"

I am in the middle of development on a new WPF app and I am having to constantly add and delete new rows from my grid as the client makes up their mind on how the form should look. I am discovering that this is quite a tedious task. If insert a row near the top, I have to manually change all the row indexes in the XAML beneath the row I just inserted.

Is there an easy way to auto-adjust all the rows?

Answer

BoomBaby picture BoomBaby · Jul 21, 2017

In Visual Studio 2015 you can also hover over the edge of a row and a little dropdown box will appear. When you click the down arrow two of the options are "move row before" and "move row after". That's the best way I've found.

Example image:

screenshot