我刚刚将我的第一个 Windows 应用程序(使用 WPF/.NET 4)部署到我们办公室的 Citrix 环境中。但是,当它运行时,windows 内的 DataGrids 比我的 Windows 7 开发环境(或我测试过的任何 Windows 桌面环境)宽得多,因此 DataGrid 的右侧被隐藏,需要一个滚动条出现在以前没有。这是思杰的“问题”吗?我是否错误地布置了我的 Windows 以解释这种差异?缺少哪些 Windows .NET 更新?感谢这里的任何建议。
(Citrix Env:在 Server 2008 R2 上运行 XenApp 6.5)
这是我的窗口 XAML:
<Window x:Class="TableMaint.ItemClassExtrasEdit"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:TableMaint"
Title="Edit Item Class Extra Fields" Height="600" Width="331" MinWidth="100" MinHeight="300" WindowStartupLocation="CenterOwner">
<DockPanel LastChildFill="True">
<Grid Height="59" DockPanel.Dock="Bottom">
<Button Content="Save" Height="23" Name="OKButton" Width="75" Margin="0,0,6,18" VerticalAlignment="Bottom" HorizontalAlignment="Right"
IsDefault="True" Click="OKButton_Click" />
<Button Content="Cancel" Height="23" HorizontalAlignment="Right" Margin="0,0,101,18" Name="CancelButton" VerticalAlignment="Bottom" Width="75"
IsCancel="True" />
</Grid>
<DataGrid Name="ExtrasGrid" ItemsSource="{Binding}" CanUserReorderColumns="False" CanUserDeleteRows="False" CanUserAddRows="False"
AutoGenerateColumns="False" RowHeaderWidth="20" CanUserResizeRows="False" CanUserSortColumns="False">
<DataGrid.Resources>
<local:NullCheckBoxConverter x:Key="nullCheckBoxConverter"/>
</DataGrid.Resources>
<DataGrid.Columns>
<DataGridTextColumn Header=" Item Class ID " Binding="{Binding ItemClassID}" >
<DataGridTextColumn.CellStyle>
<Style TargetType="{x:Type DataGridCell}">
<Setter Property="ToolTipService.ToolTip" Value="{Binding ItemClassName}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridCheckBoxColumn Header="Foo1" Binding="{Binding Foo1, Converter={StaticResource nullCheckBoxConverter}}" />
<DataGridCheckBoxColumn Header="Foo2" Binding="{Binding Foo2, Converter={StaticResource nullCheckBoxConverter}}" />
<DataGridCheckBoxColumn Header="Foo3" Binding="{Binding Foo3, Converter={StaticResource nullCheckBoxConverter}}" />
<DataGridCheckBoxColumn Header="Foo4" Binding="{Binding Foo4, Converter={StaticResource nullCheckBoxConverter}}" />
</DataGrid.Columns>
</DataGrid>
</DockPanel>
</Window>