Professional UI Solutions
Site Map   /  Register
 
 

Forum

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 » CExtGridWnd Collapse All
Subject Author Date
Mac Will Dec 23, 2005 - 11:45 AM

Hi,


I am having some difficulty with what I am doing.

I have a grid window and i insert ’objects’ into the grid. each object takes up two rows.  I would like for when i select either of the rows for both rows to become selected.  also when i hover over the rows i would like objects (ie. 2 rows) to get highlighted versus single row highlighting.


 


Any help would be greatly appreciated.


 


M

Mac Will Jan 3, 2006 - 6:52 AM

Hello,


Sorry for the delay...

Orders(full-row) is most like my grid except each "order" would actually consist of two adjacent rows.


Thanks

Technical Support Dec 23, 2005 - 1:21 PM

You can override the CExtGridBaseWnd::OnGbwSelectionChanged() virtual method which notifies about any kind of modification in the selection. The selection is implemented as an array of CRect objects, whose members specify row/column indices. So, you can traverse all the rectangles describing the selection and analyze each of them. If a rectangle covers only one column but needs to cover two, then you can change it. Please use the following methods of the CExtGridBaseWnd class:

 
virtual INT SelectionGetAreaCount() const;
virtual CRect SelectionGet(
    bool bNormalized,
    INT nAreaNumber // -1 - get normalized union of all areas
    ) const;
virtual bool SelectionSetAt(
    INT nAreaNumber,
    const RECT & rcNewSelection,
    bool bRedraw = true
    );
This API allows you to walk through all the rectangles in selection and modify any of them. You may also set appropriate grid window styles and highlight the entire row including/excluding outer header columns when the mouse moves over grid cells and you can find such a grid window in the SimpleGrids sample. Please let us know which grid in the SimpleGrids sample is closest to your requirements.