This is my XAML page
<data:DataGridTemplateColumn Width="*">
<data:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Border BorderThickness="0"
BorderBrush="Gray"
Height="Auto">
<Grid Margin="0,0,0,20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto"
MaxWidth="60" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<HyperLinkButton F>
<Grid x:Name="grdFAQs"
Horiz>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="10" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="20" />
<RowDefinition Height="20" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock x:Name="txtbAutogeneratedID"
Visibility="Collapsed" />
<Image Source="../Images/Minimize1.png"
Margin="0,0,4,0"
Tag="Mininmum"
Visibility="Collapsed"
Grid.Row="0"
Grid.Column="0"
x:Name="imgminimize"
Height="10"
Width="10"
VerticalAlignment="Center"
ToolTipService.ToolTip="{Binding minimise,Source={StaticResource resourceFile}}"
Horiz/>
<Image Source="../Images/add1.png"
x:Name="imgmaxmize"
Height="10"
Width="10"
Grid.Row="0"
Grid.Column="0"
Margin="0,0,0,0"
ToolTipService.ToolTip="{Binding maximise,Source={StaticResource resourceFile}}"
VerticalAlignment="Center"
Horiz/>
<TextBlock Margin="3,0,0,0"
Horiz/>
<TextBlock Margin="3,0,0,0"
Horiz/>
<TextBlock Text="{Binding FAQ_ANSWER}"
Visibility="Collapsed"
TextWrapping="Wrap"
x:Name="txtAnswer"
Margin="3,10,0,0"
VerticalAlignment="Top"
Foreground='Black'
Style='{StaticResource TitleStyle2}'
Horiz/>
</Grid>
</HyperLinkButton>
<StackPanel Orientation="Horizontal"
Grid.Row="0"
Grid.Column="2"
Margin="0,3,0,0">
<HyperLinkButton Height="20"
Margin="0,0,0,0"
Horiz>
<Image Source="../Images/documents_folder-48.png"
Height="22"
Width="18" />
</HyperLinkButton>
<HyperLinkButton Height="20"
Horiz>
<Image Source="../Images/video.png"
Margin="8,0,0,0"
Height="40"
Width="30" />
</HyperLinkButton>
<HyperLinkButton Height="30"
Horiz>
<Image Source="../Images/appbar.link.png"
Margin="2,0,0,0"
Height="50"
Width="30" />
</HyperLinkButton>
</StackPanel>
</Grid>
</Border>
</DataTemplate>
</data:DataGridTemplateColumn.CellTemplate>
</data:DataGridTemplateColumn>
And the code behind
public void hlnkbtnminimize_Click(object sender, RoutedEventArgs e)
{
var ctr = e.OriginalSource as HyperlinkButton;
DependencyObject dep = (DependencyObject)e.OriginalSource;
if (ctr != null)
{
Image objminImg = (Image)(ctr.FindName("imgminimize"));
Image objmaxImg = (Image)(ctr.FindName("imgmaxmize"));
TextBlock objAnswer = (TextBlock)(ctr.FindName("txtAnswer"));
TextBlock objSerialNo = (TextBlock)(ctr.FindName("txtbAutogeneratedID"));
objAutogeneratedSerialNo =Convert.ToInt32(objSerialNo.Text);
int serialNo = (objAutogeneratedSerialNo) ;
objchk=Convert.ToString(ctr.Tag);
if (objminImg.Visibility == Visibility.Visible)
{
objminImg.Visibility = Visibility.Collapsed;
objmaxImg.Visibility = Visibility.Visible;
DataGridRow row = (DataGridRow)dep;
row.DetailsVisibility = Visibility.Collapsed;
if (objAutogeneratedSerialNo == serialNo)
{
GVMarketList.RowDetailsVisibilityMode = DataGridRowDetailsVisibilityMode.Collapsed;
}
}
else
{
GVMarketList.RowHeight = double.NaN;
objAnswer.Height = double.NaN;
objmaxImg.Visibility = Visibility.Collapsed;
objminImg.Visibility = Visibility.Visible;
objAnswer.Visibility = Visibility.Visible;
}
}
}
I tried with everthing but not able to collapse the height of the row when collpasing the content in it.
You can Find the image links here
http://imagebin.ca/v/1bI9yobAzd4E[
^]
[
^]
Any help plz....