|
|
|
|
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 |
|
Paul Cowan
|
Oct 11, 2007 - 9:18 AM
|
I have a data grid with buttons in the cells (using __EGCS_BUTTON_ELLIPSIS). If I make a cell read-only, the button is disabled. I still need the button to work in these cells. How can I have an enabled button in a read-only cell?
|
|
Technical Support
|
Oct 13, 2007 - 12:11 PM
|
We are not completely sure what result you are expecting to get but if you need a cell without inplace editor, the __EGCS_NO_INPLACE_CONTROL cell style can be more suitable than __EGCS_READ_ONLY .
Read-only cells come with an in-place editor, but it is read-only. In the case of the disabled in-place editor, it is not activated at all pCell->ModifyStyle( __EGCS_NO_INPLACE_CONTROL );
|
|
Paul Cowan
|
Oct 11, 2007 - 1:34 PM
|
Thanks for the info. I now have the button enabled, however clicking the button doesn’t work. I’m using CExtGridWnd::OnGridCellButtonPressed to detect and handle the button clicking, but this is not being called because CExtGridCell::OnClick checks if the cell is read-only. I don’t want to override OnClick for every cell type. How do I work around this?
|
|
Technical Support
|
Oct 11, 2007 - 10:50 AM
|
You can control if a cell button is enabled or disabled by overriding CExtGridCell::OnQueryButtonInfo() virtual bool OnQueryButtonInfo(
INT nButtonType,
bool * p_bEnabled,
bool * p_bPressed = NULL,
bool * p_bStayPressed = NULL,
UINT * p_nTimerElapseValue = NULL
) const;
|
|