|
|
|
|
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.
Subject |
Author |
Date |
|
Johannes Schwenk
|
Aug 14, 2008 - 6:13 AM
|
Hi, I`m using the Grid class from the Ado Recordset Edit example in my VC++ 8. Now i have the following Problems: 1) I can not really select cells. It seems to be not a problem of the styles, the "select" event seems to do somethinh wrong: When I have a cell with a checkbox style, and I change the status of the checkbox, my cell is selected (changes it’s color to selected color, select arrow is shown on the left outer column). But when I click on the cell without changing the checkbox status, or when my cell does not have a checkbox but a text, than nothing happens. Can you tell me what is wrong? 2) I want to change the color of the whole row, when one of the cells is selected. In my last post, I got the answer that I have to overide the CExtGridWnd::OnGbwAnalyzeCellMouseClickEvent() function, and set the backcolor of the cells in the actual row. But how can I get the number of the actual row with the CPoint Value the functions gets? Thanks for your Help, Johannes Schwenk
|
|
Technical Support
|
Aug 24, 2008 - 11:59 AM
|
1) We think the problem is that you may have not specified any selection type. Here are the corresponding types: #define __EGBS_SFB_CELLS 0x00001000L
#define __EGBS_SFB_FULL_ROWS 0x00002000L
#define __EGBS_SFB_FULL_COLUMNS 0x00003000L Moreover you were able to select cells by clicking the check box because it was a bug. We fixed it. 2) It seems you want to implement the full row selection model with a custom selection color. You can do this in other way. First specify the __EGBS_SFB_FULL_ROWS grid style which sets the selection model when a single cell selection is interpreted as a full row selection. Then, using the CExtGridCell::BackColorSet method, assign a new background color for the cell when it is selected. You can use the __ECS_SELECTED flag for that.
|
|