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 » row unselection in a grid Collapse All
Subject Author Date
Nathan Explosions Jun 25, 2007 - 12:05 AM

Greetings.

Please tell me, how can I programmatically remove the selection from the given grid row and save the selection of other rows if there is any?

I can do this manually in my grid, but I can not find a method, which would allow me to subtract the selection of a single row...

Thank you.

Nathan Explosions Jun 25, 2007 - 8:32 AM

Thank you for your help! The problem is no more.

Technical Support Jun 25, 2007 - 5:45 AM

The selection is implemented as an array of CRect objects, with each rectangle describing the selected cell range. You can access to these objects using a set of CExtGridBaseWnd::Selection***() methods. The solution depends on whether you are using the intersected or non-intersected selection model. Each grid cell can be covered by several selection rectangles. In the intersected selection, if the cell is covered by at least one rectangle, then it is selected and you have to re-combine the selection area rectangles, which is not easy. In the case of non-intersected selection, the cell is selected if it is covered by an odd number of rectangles. This is the most widely used selection technique and you should simply add one rectangle if you what the cell becomes unselected/selected. Both selection models are demonstrated in the SimpleGrids sample application and described in the Help bar.