visual c++ - Selected cells CGridCtrl from codeproject -
i need find selected cells control cgridctrl using following code.
ccellrange cells = m_grid.getselectedcellrange(); if( cells.count() == 0 ) return ; (int = cells.getmaxrow(); >= cells.getminrow(); i--) { (int j=cells.getmincol(); j<=cells.getmaxcol();j++) { bool selected = m_grid.getcell(i,j)->isselected(); trace(_t("row %d column %d selected = %d state %d\n"),i,j,selected, m_grid.getcell(i,j)->getstate()); if(selected) { m_grid.deleterow(i); break; } } }
since cells selected not contiguous, need use isselected() find cell selected. last cell return true. there way determine cells selected control?
i don't know if flag in cells correct, correct function check if cell selected are:
bool cgridctrl::iscellselected(ccellid &cell) const bool cgridctrl::iscellselected(int nrow, int ncol) const
just check implementation. there m_selectedcellmap contains selected ranges.
Comments
Post a Comment