我希望能够编辑行dtetailsTemplate控件中显示的数据。有可能吗?
我在RowDetailsTemplate gridview中有一个网格视图,我试图更新它,但无法获得更改。它总是返回值不变。
数据网格:
<HDataGridEx x:Name="dgrd1" Grid.Row="1" ItemsSource="{Binding MEDICALRECORDCOPYPRINTING_HMEINFO_LIST}" HeadersVisibility="All" IsShowCheckHeader="False" AutoGenerateColumns="False"
IsReadOnly="True" SelectionMode="Single" SelectionUnit="FullRow" ShowRowIndex="True" CanUserSelectRowHeader="False"
SelectedItem="{Binding MEDICALRECORDCOPYPRINTING_HMEINFO_ITEM}" GridLinesVisibility="None" RowDetailsVisibilityMode="Collapsed" RowHeight="35"
AlternatingRowBackground="{StaticResource AlternatingRowBackgroundBrush}" >
数据网格中的行详细信息模板:
<HDataGridEx.RowDetailsTemplate>
<DataTemplate>
<Border x:Name="grdPrnt" Background="{StaticResource RowExpanderBackground}" Margin="3"
DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=HDataGridEx}, Path=DataContext}" >
<HDataGridEx x:Name="dgrd2" GridLinesVisibility="All" IsReadOnly="False"
HeadersVisibility="Column" HasRowHeaderStatus="False"
ItemsSource="{Binding MEDICALRECORDCOPYPRINTING_HMEINFO_LIST_SECOND , Mode=TwoWay}"
CanUserSelectRowHeader="False"
SelectionUnit="FullRow"
Margin="5">
</HDataGridEx>
</Border>
</DataTemplate>
</HDataGridEx.RowDetailsTemplate>
save命令:
<HButton Content="{LanguageResource Source=MS, Path=Alias.MSD_012493, Description='Modification'}" Style="{StaticResource CommonButtonSaveStyle}" DockPanel.Dock="Right" Margin="0,0,5,0" PermissionManager.ButtonPermission="Write" Command="{Binding SaveCommand}" CommandParameter="{Binding ElementName=dgrd2}" Visibility="{Binding SAVEVISIBILITY}" />
并且以下条件中的值始终为真:
if (this.MEDICALRECORDCOPYPRINTING_HMEINFO_LIST_SECOND.GetChanges().Count <= 0)
{
MsgBox.Display("MSMCN_001619", MessageType.MSG_TYPE_INFORMATION, Owner: this.OwnerWindow, TimeSpan: 1000);
// NO DATA CHANGE
return;
}