devexpress gridcontrol tableview

时间:2015-10-13 07:59:06

标签: wpf xaml mvvm devexpress

我在我的MVVM项目中使用了devexpress gridcontrol tableview。当我在小屏幕中打开应用程序水平滚动工作不正确。数据保持不变但列标题滚动。我试图在DevExpress支持中心及其手册中使用提示,但它无法正常工作。这是我的XAML代码:

<dxg:GridControl Name="GridControl"
                 dx:ThemeManager.ThemeName="LightGray"
                 ItemsSource="{Binding List}"
                 SelectionMode="Row"
                 HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                 HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">

            <dxg:GridControl.Columns>
                <dxg:GridColumn Header="" 
                                FieldName="Left" 
                                HorizontalHeaderContentAlignment="Center" 
                                Width="1" FixedWidth="True" AllowResizing="False" Fixed="Left"
                                AllowSorting="True" AllowGrouping="False" AllowAutoFilter="False"
                                Visible="False" 
                                AllowBestFit="True" BestFitArea="Rows"/>
                <dxg:GridColumn Header="" 
                                FieldName="Right" 
                                HorizontalHeaderContentAlignment="Center" 
                                Width="1" FixedWidth="True" AllowResizing="False" Fixed="Right"
                                AllowSorting="True" AllowGrouping="False" AllowAutoFilter="False"
                                Visible="False" 
                                AllowBestFit="True" BestFitArea="Rows"/>
                <!-- Column example -->                
                <dxg:GridColumn Header="Head" 
                                FieldName="Name" 
                                HorizontalHeaderContentAlignment="Center" 
                                Width="1" FixedWidth="True" AllowResizing="False" Fixed="Left"
                                AllowSorting="True" AllowGrouping="False" AllowAutoFilter="False"
                                Visible="False" 
                                AllowBestFit="True" BestFitArea="Rows"/>
                ...
            </dxg:GridControl.Columns>

            <dxg:GridControl.GroupSummary>
                <dxg:GridSummaryItem FieldName="TechnologyName" SummaryType="Count"/>
            </dxg:GridControl.GroupSummary>

            <dxg:GridControl.TotalSummary>
                <dxg:GridSummaryItem SummaryType="Count" Alignment="Right"/>
            </dxg:GridControl.TotalSummary>

            <dxg:GridControl.View>
                <dxg:TableView x:Name="gridView"
                               dx:ThemeManager.ThemeName="MetropolisLight"
                               ShowFixedTotalSummary="True" 
                               WaitIndicatorType="Panel" 
                               ShowFilterPanelMode="Never" ShowAutoFilterRow="True" AllowFilterEditor="False" 
                               AutoWidth="False" AllowFixedColumnMenu="True" AllowPerPixelScrolling="True"
                               HorizontalScrollbarVisibility="Visible" AllowScrollHeaders="False" 
                               NavigationStyle="Row"
                               AllowEditing="False" 
                               ShowGroupPanel="False" AllowGrouping="False"
                               ShowSearchPanelMode="Never"
                               AllowBestFit="True" BestFitArea="Header"> 
                    <dxg:TableView.DataRowTemplate>
                    <!-- Row template -->
                        ...

2 个答案:

答案 0 :(得分:0)

最大。我有同样的问题,不知道如何通过GridControl设置解决它。我使用此解决方法:尝试通过ScrollViewer包装您的gridControl

<ScrollViewer HorizontalScrollBarVisibility="Auto" 
                      VerticalScrollBarVisibility="Auto"
                      HorizontalContentAlignment="Stretch"
                      VerticalContentAlignment="Stretch"
                      Grid.Row="0">
            <dxg:GridControl x:Name="realPipeLineWorkGridControl"
                             Grid.Row="0"
                             MaxHeight="8000"
                             ScrollViewer.HorizontalScrollBarVisibility="Hidden"
                             ScrollViewer.VerticalScrollBarVisibility="Hidden"...

答案 1 :(得分:0)

您需要设置gzip foo.txt # now foo.txt has been deleted, and foo.txt.gz exists gunzip foo.txt.gz # now you have foo.txt back, and foo.txt.gz has been deleted. 来解决问题。