2

I've a huge grid in wpf (xaml)

<Grid Width="400" Height="400">
<Grid.RowDefinitions>
    <RowDefinition Height="Auto"></RowDefinition>
    <RowDefinition Height="Auto"></RowDefinition>
    <RowDefinition Height="Auto"></RowDefinition>
    <RowDefinition Height="Auto"></RowDefinition>
    <RowDefinition Height="Auto"></RowDefinition>
    <RowDefinition Height="Auto"></RowDefinition>
    <RowDefinition Height="Auto"></RowDefinition>
    <RowDefinition Height="Auto"></RowDefinition>
    <RowDefinition Height="Auto"></RowDefinition>
    ...
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
    <ColumnDefinition></ColumnDefinition>
    <ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>


<Label>1</Label>
<TextBox Grid.Column="1"></TextBox>

<Label Grid.Row="1">1</Label>
<TextBox Grid.Column="1" Grid.Row="1"></TextBox>

<Label Grid.Row="2">2</Label>
<TextBox Grid.Column="1" Grid.Row="2"></TextBox>

...
...
...

I would like to add a row at the top of my grid. For now, I change Grid.Row="1" by Grid.Row="2" and Grid.Row="2" by Grid.Row="3" ... It's really painful !

Is there any solution to add rows without changing all ID ?

Muds
  • 4,006
  • 5
  • 31
  • 53
Titouan56
  • 6,932
  • 11
  • 37
  • 61
  • I am keenly looking for answer to this, every time I have to deal with something like this .. I get requirements changed ..! – Muds May 11 '15 at 13:37
  • Which Visual Studio version are you using? [Here](http://stackoverflow.com/questions/13127688/visual-studio-2012-silverlight-xaml-designer-insert-grid-row-before-after)'s an answer for 2012. – molnarm May 11 '15 at 13:38
  • @MártonMolnár Yeah ! That works, thanks ! (so hard to find) – Titouan56 May 11 '15 at 13:47
  • @dkozl Cause I'm a newbie and it's the simplest solution I found, but why not – Titouan56 May 11 '15 at 13:49

0 Answers0