Print Page | Close Window

Grid row without children not indented (CJ 24.2)

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=24602
Printed Date: 02 November 2025 at 11:58am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Grid row without children not indented (CJ 24.2)
Posted By: Heath
Subject: Grid row without children not indented (CJ 24.2)
Date Posted: 11 September 2025 at 4:02am
Following migration from CJ 24.1 to 24.2, the grid ident for rows without children are no longer indented to align with rows with children (with the expand icon). 

The release notes say...

Text indent computation fixed for a group row with no icon
Default tree item indentation fixed in Grid control

I used the fix below where pGridCtrl is a pointer to CXTPGridControl.

CXTPGridPaintManager* pGridPaintManager = pGridCtrl->GetPaintManager();
pGridPaintManager->m_nTreeTextIndent = 25;
pGridPaintManager->m_nTreeTextIndentRowChildren = 25;

I assume this is a bug as the default has been changed from the behaviour seen in many previous releases.

Regards,
Heath



Replies:
Posted By: dbrookes
Date Posted: 15 September 2025 at 3:57am
I found this issue in 24.2 as well. It looked like the change made it so that the expand button space is not taken by an item without children. Meaning items on the same level didn't line up anymore. But that also caused other issues like the in-place edit control no longer lining up with the item text. I ended up patching the grid record item drawing to revert the change. 

Here is a patch:
diff --git Source/GridControl/XTPGridRecordItem.cpp Source/GridControl/XTPGridRecordItem.cpp
index 0011a04d..4b31aba3 100644
--- Source/GridControl/XTPGridRecordItem.cpp
+++ Source/GridControl/XTPGridRecordItem.cpp
@@ -829,9 +829,9 @@ int CXTPGridRecordItem::Draw(XTP_GRIDRECORDITEM_DRAWARGS* pDrawArgs)
             nTreeTextIndent = pPaintManager->m_nTreeTextIndentRowChildren;
         }
 
-        rcItem.left = rcBitmap.left + nTreeTextIndent;
-        if (bHasChildren)
-            rcItem.left += sizeBitmap.cx;
+        rcItem.left = rcBitmap.left;
+        rcItem.left += sizeBitmap.cx;
+        rcItem.left += nTreeTextIndent;
     }
 
     pDC->SetTextColor(pMetrics->clrForeground);


Posted By: mgampi
Date Posted: 22 October 2025 at 11:10am
Hi;
The bug fix mentioned does not solve the indention problem (see first two rows):


Still waiting for a fix to solve this problem!


-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net