lundi 11 mai 2015

Add row without changing all Column/Row id

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 ?

Thanks

Aucun commentaire:

Enregistrer un commentaire