Objective Grid: Making column widths relative to the size of the grid

Article ID: 685
Last updated: 22 Jun, 2018
Article ID: 685
Last updated: 22 Jun, 2018
Revision: 3
Views: 1993
Posted: 23 Jan, 2001
by Meltreger B.
Updated: 22 Jun, 2018
by Meltreger B.

Problem


How can I make column widths relative to the size of the grid? In other words, they should increase/decrease as the view size is changed.


Cause



Action


You could override GetColWidth( ), e.g. if you have five columns:

int CYourGrid::GetColWith(ROWCOL nCol)
{
CRect rect = GetGridRect( );
return rect.Width( )/5;
}

So, when the grid size changes all column width will change automatically.

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

Others in this category