Hi,
I have this XAML:
<Grid Margin="15">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Grid.Column="0" Grid.Row="0" x:Name="LabelMemberFirstName" Text="First Name :" FontAttributes="Bold" TextColor="Red" VerticalTextAlignment="Center" Margin="0,0,15,15" />
<Label Grid.Column="1" Grid.Row="0" x:Name="LabelMemberFirstNameDetails" VerticalTextAlignment="Center" Margin="0,0,15,0" />
<Label Grid.Column="0" Grid.Row="1" IsVisible="False" x:Name="LabelMemberSecondName" Text="Second Name :" FontAttributes="Bold" TextColor="Red" VerticalTextAlignment="Center" Margin="0,0,15,15" />
<Label Grid.Column="1" Grid.Row="1" IsVisible="False" x:Name="LabelMemberSecondNameDetails" VerticalTextAlignment="Center" Margin="0,0,15,0" />
<Label Grid.Column="0" Grid.Row="4" x:Name="LabelMemberLastName" Text="Last Name :" FontAttributes="Bold" TextColor="Red" VerticalTextAlignment="Center" Margin="0,0,15,15" />
<Label Grid.Column="1" Grid.Row="4" x:Name="LabelMemberLastNameDetails" VerticalTextAlignment="Center" Margin="0,0,15,0" />
</Grid>
I am checking at the codebehind for the second name value for example:
if (!string.IsNullOrWhiteSpace(Convert.ToString(data[0].second_name)))
{
LabelMemberSecondNameDetails.Text = Convert.ToString(data[0].second_name);
LabelMemberSecondName.IsVisible = true;
LabelMemberSecondNameDetails.IsVisible = true;
}
else
{
LabelMemberSecondName.IsVisible = false;
LabelMemberSecondNameDetails.IsVisible = false;
}
but that is leaving a space of the row which result many spaces when I have second, third and fourth name.
How can I hide the row or set it's row to zero after checking for the value and when setting the LabelMemberSecondName and LabelMemberSecondNameDetails to false?
Thanks,
Jassim