I have set EnableTrackRowHeight(GX_TRACK_ALL), but some rows are not getting resized at all. What is wrong?
EnableTrackRowHeight(GX_TRACK_ALL); forces the grid to call SetDefaultRowHeight() whenever the user is resizing a row.
SetDefaultRowHeight() changes the default height but that doesn't affect any cells where you have stored an individual row height with SetRowHeight.
So, what you can do is change the behavior of OnEndTracking (which calls SetDefaultRowHeight() ) and force it to remove all individual row heights.
In the OnEndTracking override you can empty all previous row heights with
GetParam()->m_RowHeights.RemoveAll();
GetParam()->m_ColWidths.RemoveAll();
You can save and restore the height of the header rows with
nHeight = GetParam()->m_RowHeights[0];
and after emptying assign them back with
GetParam()->m_RowHeights[0] = nHeight;
Example:
void CDevGrid::OnEndTracking(ROWCOL nRow, ROWCOL nCol, int nTrackingMode, CSize& size)
{
CGXGridParam *pParam = GetParam();
LockUpdate(TRUE);
CGXGridWnd::OnEndTracking(nRow, nCol, nTrackingMode, size);
if (nTrackingMode == GX_TRACKWIDTH)
{
pParam->m_ColWidths.RemoveAll();
}
else
{
LONG nHeight = pParam->m_RowHeights[0];
pParam->m_RowHeights.RemoveAll();
pParam->m_RowHeights[0] = nHeight;
}
LockUpdate(FALSE);
Redraw();
return;
}