wxGrid - disallow multiple row/column selection...?

Volker Bartheld dr_versaeg at freenet.de
Fri Feb 16 07:31:10 PST 2007


Hi!

I don't want the user to select multiple rows or columns in a wxGrid.
How do I do that?

I've experimented with

EVT_GRID_RANGE_SELECT(wxMyGrid::OnGridRangeSelect)
void wxControlGrid::OnGridRangeSelect(wxGridRangeSelectEvent& event)
{
  if(m_bAllowRangeSelect) { event.Skip(true); return; } // multiple selection allowed
  if(event.GetTopRow()!=event.GetBottomRow() && event.Selecting()) SelectRow(event.GetTopRow());   // collapse rows if necessary
  if(event.GetLeftCol()!=event.GetRightCol() && event.Selecting()) SelectCol(event.GetLeftCol());  // collapse columns if necessary
}

but no luck (no selection possible at all).

Thanks & have a nice weekend!


Volker
__
Mail replies to/an V B A R T H E L D at G M X dot D E






More information about the wx-users mailing list