Reputation: 67
I have a named textblock
row within a named data grid that I would like to delete. Given that I know the name of the grid and the row, how do I delete the textblock? I expected to find something like:
row_01.Delete();
But no such luck. Here is the XAML:
<Grid Name="grid_01">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="10" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Name="row_01" Height="10"/>
<RowDefinition Name="row_02" Height="*" />
</Grid.RowDefinitions>
<Border BorderThickness="5" BorderBrush="Black" Grid.Row="1" Grid.Column="1">
<TextBlock Grid.Column="1" Grid.Row="1" Name="Tag_ContinueAs" Text="Continue as Bejay" HorizontalAlignment="Center" />
</Border>
Upvotes: 1
Views: 91
Reputation: 768
IN order to delete a Row, use:
grid_01.RowDefinitions.Remove(row_01);
Upvotes: 2