[ WPF ] DevExpress.Xps.grid.GridControl怎么可以让所有内容居中显示?

2025-03-23 17:27:52
推荐回答(2个)
回答(1):

    对于列头Header居中,使用HorizontalHeaderContentAlignment=“Center”即可。

    对于列值居中,更改列的EditSettings,设置对应的EditSettings的HorizontalContentAlignment="Center"即可。


示例代码如下:

        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid" 
        xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" 
        x:Class="WpfApplication18.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    
        
            
            
            
            
                
                    
                

            
        
    

    
        
            
                
                
            

            
                
            

        
    


效果如下:

回答(2):

您好这是百度比较有权威的笔记本电脑的选择文章,里面很全面的叙述了挑选文章的技巧,您可以看看,也可以百度hi作者,或者也可以百度hi我,尽量帮助您。
http://jingyan.baidu.com/magazine/7247