Professional UI Solutions
Site Map   /  Register


Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » GridWnd and programmatically set selection Collapse All
Subject Author Date
Jeremy Ruth Sep 21, 2008 - 10:06 PM

I have a CExtGridWnd derived class with the __EGBS_SFB_FULL_ROWS property set so my selection is always the full row.

What I am trying to do is: after I load the grid, I want to programmatically set a given row as being selected AND capture that selection as if the mouse made the selection (will the programmatic set selection automatically fire OnGbwSelectionChanged or should I call it)?

Technical Support Sep 22, 2008 - 12:02 PM

The selection in a CExtGridWnd control is managed by a set of CExtGridWnd::Selection***() methods. There is an array of CRect objects that is is used for describing selected cell areas in the grid independently from the used selection model. Each of the CRect objects contains row/column numbers of a selected range of grid cells. In the case of full row selection model, each rectangle has zero in the CRect::left property and value equal to CExtGridWnd::ColumnCountGet()-1 in the CRect::right property.

Jeremy Ruth Sep 22, 2008 - 3:37 PM

Wow!  That was easy.  Thank you.