DuiLib_DuiEditor Grid

261 篇文章 10 订阅
24 篇文章 6 订阅

xml配置列头:

<Grid name="grid_main" virtualgrid="true" columnwith="150" fitcolumns="false" ascendingimage="file='images\common\list\listhead_arrow.png' source='0,0,18,18' " descendingimage="file='images\common\list\listhead_arrow.png' source='18,0,36,18' " sorticonsize="18,18" fixedcell="bkcolor=&quot;0xFFF2F2F2&quot; bordercolor=&quot;0xFFC0C0C0&quot; bordersize=&quot;1&quot; " row="selectedbkcolor=&quot;0xFFA6CAF0&quot; hotbkcolor=&quot;0xFFF0F0F0&quot; hottextcolor=&quot;0xFFFF0000&quot; hotfont=&quot;5&quot; " cell="selectedbkcolor=&quot;0xFFC0DCC0&quot; selectedtextcolor=&quot;0xFFFF0000&quot; selectedbordercolor=&quot;0xFF000080&quot; hotbkcolor=&quot;0xFFFF00FF&quot; hotfont=&quot;5&quot; childalign=&quot;center&quot; childvalign=&quot;vcenter&quot; bordercolor=&quot;0xFFC0C0C0&quot; bordersize=&quot;1&quot; " edit="align=&quot;center&quot; valign=&quot;center&quot; " checkbox="width=&quot;18&quot; height=&quot;16&quot; selectedimage=&quot;images\check-select.png&quot; normalimage=&quot;images\check-unselect.png&quot; " combo="dropbuttonsize=&quot;21,21&quot; dropbuttonnormalimage=&quot;file='images\common\combobox\dropbtn.png' source='21,0,42,21' &quot; dropbuttonhotimage=&quot;file='images\common\combobox\dropbtn.png' source='21,0,42,21' &quot; dropbuttonpushedimage=&quot;file='images\common\combobox\dropbtn.png' source='42,0,63,21' &quot; " picture="width=&quot;32&quot; height=&quot;32&quot; " bkcolor="0xFFFFFFFF">
                <GridHeader>
                    <GridRow>
                        <GridCell />
                        <GridCell celltype="check" text="col1" />
                        <GridCell text="text" />
                        <GridCell text="edit" />
                        <GridCell text="combo" />
                        <GridCell merge="0,5,0,7" text="datetime" />
                        <GridCell mergedwithothers="true" />
                        <GridCell mergedwithothers="true" />
                        <GridCell text="operator" />
                        <GridCell text="picture" />
                    </GridRow>
                    <GridRow>
                        <GridCell />
                        <GridCell celltype="check" text="col1" />
                        <GridCell />
                        <GridCell />
                        <GridCell />
                        <GridCell text="datetime" />
                        <GridCell text="date" />
                        <GridCell text="time" />
                        <GridCell />
                        <GridCell />
                    </GridRow>
                </GridHeader>
            </Grid>

初始化代码:

void CMainFrame::InitWindow()
{
    UI_BINDCONTROL(CGridUI, m_pGrid, _T("grid_main"));

    m_pGrid->SetRowCount(20);
 
    ddxSetManager(GetManager());
    
    GetGridPara();
    m_pGrid->SetCellType(1, celltypeCheckBox);
    //m_pGrid->SetCellType(2, celltypeText);
    m_pGrid->SetCellType(3, celltypeEdit);
    m_pGrid->SetCellType(4, celltypeCombo);
    m_pGrid->SetCellType(5, celltypeDateTime);
    m_pGrid->SetCellType(6, celltypeDate);
    m_pGrid->SetCellType(7, celltypeTime);
    m_pGrid->SetCellType(8, celltypeContainer);
    m_pGrid->SetCellType(9, celltypePicture);

    //剔除不允许排序的列
    m_pGrid->SetColumnSort(1, FALSE);
    m_pGrid->SetColumnSort(8, FALSE);
    m_pGrid->SetColumnSort(9, FALSE);

    m_pGrid->MergeCells(0,0,1,0);
    m_pGrid->MergeCells(0,1,1,1);
    m_pGrid->MergeCells(0,2,1,2);
    m_pGrid->MergeCells(0,3,1,3);
    m_pGrid->MergeCells(0,4,1,4);
    m_pGrid->MergeCells(0,8,1,8);
    m_pGrid->MergeCells(0,9,1,9);

}

实现效果:

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值