红鱼儿

定制uniGUI Grid表头高度

uniGUI的Grid表头,没有提供delphi属性来定制,原因是因为支持多级表头,需要自动计算。但如果不定制,造成表头高度与行高不致。通过css,可以定制表头高度,但对于多级表头来说,又无法自动计算了。这是个矛盾,怎么能两全其美呢?

办法是有的,我们先定义一个固定高度表头的css,放到uniServerModule.CustomCSS中:

.kls-grid .x-column-header
{
    background-color: #F7F7F7;
    background-image:initial;
    /* border-width: 0px !important;  */
    border-right: 0px solid #e0e0e0;
    height:30px; 
}

.kls-grid .x-grid-header-ct{
    background-color: #F7F7F7;
    background-image:initial;
    border:initial;
    border-bottom-width: 1px !important;
    border-bottom-color: #E4E4E4 !important;
    border-bottom: 1px solid #E4E4E4 !important;
    height:30px; 
}

注意,这个启了名子:kls-grid

对于非多级表头的Grid,我们设置他的属性:

uniDBGrid.LayoutConfig.ComponentCls:='kls-grid'

对于多级表头的Grid,我们不设置uniDBGrid.LayoutConfig.ComponentCls

 

posted on 2020-08-27 12:56  红鱼儿  阅读(691)  评论(0编辑  收藏  举报