CGridCtrl控件中的内容如何删除多个选中行(选中行可能不连续),请教高手

解决方案 »

  1.   

    CCellRange Selection = m_pGridCtrl->GetSelectedCellRange();
    if (!m_pGridCtrl->IsValid(Selection))
        return ;
    CGridCellBase *pCell;for (int row = Selection.GetMinRow(); row <= Selection.GetMaxRow(); row++)
    { {
      pCell = m_pGridCtrl->GetCell(row, col);
      if (pCell &&(pCell->GetState() & GVIS_SELECTED))
         m_pGridCtrl->DeleteRow(nRow); 
    }
    m_pGridCtrl->RedrawWindow() ;   
    {
      

  2.   

    来晚了 firebolt2002(霹雳)都说了
    就是找每个格的状态,如是被选择的,就deleteRow