rowdetails

How to programmatically access a datagrid row details control

Deadly 提交于 2019-12-06 21:25:57
问题 I've got a datagrid with some defined columns and then a row details template. How do I access a control in the row details template within the code behind? I've got a button that I want to programmatically enable/disable, but I can't figure out how to get access to it in the code behind. I've seen this on the MSDN: http://msdn.microsoft.com/en-us/library/bb613579.aspx but that's just describing a regular data template, so when I tried that it didn't work. My case is a row details data

How to programmatically access a datagrid row details control

江枫思渺然 提交于 2019-12-05 02:08:58
I've got a datagrid with some defined columns and then a row details template. How do I access a control in the row details template within the code behind? I've got a button that I want to programmatically enable/disable, but I can't figure out how to get access to it in the code behind. I've seen this on the MSDN: http://msdn.microsoft.com/en-us/library/bb613579.aspx but that's just describing a regular data template, so when I tried that it didn't work. My case is a row details data template. Surely someone has written code to access a control within a datagrid row details template that can

Animating WPF DataGrid Row Details

╄→尐↘猪︶ㄣ 提交于 2019-11-29 08:22:47
问题 Can anyone help me animating the WPF DataGrid row details when it's opened and closed (e.g. slides open like an accordion when the row selected and slides close when the row is not selected)? I need a simple proof of concept. Thanks in advance for your help :) 回答1: Verbose but works: <DataGrid.RowStyle> <Style TargetType="{x:Type DataGridRow}"> <Setter Property="DetailsVisibility" Value="Collapsed"/> <Style.Triggers> <Trigger Property="IsSelected" Value="True"> <Trigger.EnterActions>

DataGrid RowDetails Width problem

给你一囗甜甜゛ 提交于 2019-11-29 07:07:35
问题 Suppose I have a DataGrid that is defined like this <DataGrid AreRowDetailsFrozen="True" ItemsSource="{Binding MyCollection}" AutoGenerateColumns="False"> <DataGrid.RowDetailsTemplate> <DataTemplate> <Border CornerRadius="5" BorderBrush="Red" BorderThickness="2" Background="Black"> <TextBlock Foreground="White" Text="{Binding RowDetails}" TextWrapping="Wrap"/> </Border> </DataTemplate> </DataGrid.RowDetailsTemplate> <DataGrid.Columns> <DataGridTextColumn Header="0" Binding="{Binding Value1}"/