具体情况是这样的:CGridCtrl是网络上很出名的那个网格控件,我刚刚拿来用,不太明白怎么做。我的目的就是在一个二维表格的第一列里可以选中或者去除选择,就象我们先选中email邮箱中的几格垃圾邮件然后再删除它们一样。怎么做呢?请大侠执教,感激涕零。

解决方案 »

  1.   

    //设置显示类型 数字
    if( sItem==_T("产品编号") ) 
    {
    bRst=m_gridCtrl1.SetCellType(pItem->iRow ,pItem->iColumn,
    RUNTIME_CLASS(CGridCellNumeric));
    if( !bRst ) return FALSE ;
    }
      

  2.   

    bRst=m_gridCtrl1.SetCellType(pItem->iRow ,pItem->iColumn,
    RUNTIME_CLASS(CGridCellCombo));
    if( !bRst ) return FALSE;
      

  3.   

    1、BOOL AddComboColumn(int iCol,CStringArray &comStr);
    将iCol列设置为用组合框来编辑的模式。
    iCol:指定列
    ComStr:包含该列出现的选项
    2、BOOL SetComboItemText(int nRow,int nCol,int index);
    通过指定数据在组合框中的索引来设置网格的值。
    Nrow,nCol:网格的行列
    Index:组合框数据项的索引http://www.codetools.com/miscctrl/gridctrl_combo.asp