Objective Grid: Preventing hidden columns from becoming visible through double-clicks

Article ID: 693
Last updated: 11 Jun, 2018
Article ID: 693
Last updated: 11 Jun, 2018
Revision: 3
Views: 1748
Posted: 23 Jan, 2001
by Meltreger B.
Updated: 11 Jun, 2018
by Meltreger B.

Problem


How can I prevent the user from making hidden columns visible with a double-click?


Cause



Action


The grid always calls the virtual member OnTrackColWidth(nCol) before it will restore hidden columns.

So, you should override this method and return FALSE if you don't want the user to be able to restore the column. OnTrackColWidth(nCol) will also be called for visible columns to determine if the columns width can be changed. By calling IsColHidden(nCol) you can determine whether the columns is visible or hidden.

Example:

BOOL CMyGrid::OnTrackColWidth(ROWCOL nCol)
{
if (IsColHidden(nCol))
return FALSE; // Don't allow hidden columns to be restored
// ... but do allow visible columns to be resized
return TRUE;
}

This article was:   Helpful | Not helpful
Report an issue
Article ID: 693
Last updated: 11 Jun, 2018
Revision: 3
Views: 1748
Posted: 23 Jan, 2001 by Meltreger B.
Updated: 11 Jun, 2018 by Meltreger B.

Others in this category