1、设置TreeNode列为CheckBox:
m_Grid.SetTreeColumnCellTypeID(CT_CHECKBOX);
2、获取选中的Cell,此处需要强转:
int nRow = m_page1.m_Grid.GetRowCount();
for (int i = 0; i < nRow; ++i)
{
CGridCellCheck* cc = dynamic_cast<CGridCellCheck*>(m_page1.m_Grid.GetCell(i,1));
if (cc && cc->GetCheck())
{
//保存数据
}
时间: 2024-10-10 00:07:37