tags:

views:

140

answers:

2

I need to create a row in XAML which has a label,two radio buttons.. Based on some operation i need these row to be visible..else i need it to hidden.. I do not want the empty space to be displayed.. Is this possible only through code? If so can anyone help me out please?

A: 

What do you mean by "row"? A DataGridRow? An item in a vertical StackPanel?

Is this row part of a DataTemplate for an item?

Without knowing more, it's hard to say.

But basically, you can bind some value trough a ValueConverter to the UIElement.Visibility property if what you want is to hide/show any UiElement.

kek444
+3  A: 

Place the row in a grid and set it's height set to 'Auto'. Place your controls in a grid (or other container) and set it's Visibility to Collapsed for not visible and Visible for when you need to show it.

<Grid>
 <Grid.RowDefinitions>
  <RowDefinition />
  ...
  <RowDefinition Height="Auto" />  <!-- Your 'hidden' row -->
  ...
 </Grid.RowDefinitions>

 <!-- your collapse content -->
 <Grid Grid.Row="2" Visible="Collapsed" x:Name="hiddenRow">
  ....your controls...
 </Grid>
</Grid>

Then to show the controls...

hiddenRow.Visible= Visibility.Visible;

Hope that helps....

Martin Randall