Hello,
I'm using ElXTree as a grid. Column 0 should show a bitmap.
I tried many configurations, OwnerDrawByColumn, elhsOwnerDraw...... but I never get it work without changing the ElPack sources.
OnCellDraw paints the bitmap but then I have to paint everything, even the grid-lines, which i don't want to paint myself.
That can't be that complicated;)
Best regards
Andre Engelshove
Comments
please take a look at the lines at line number 5876 in ElXTree.pas:
if ((LCell.CurrentStyle.DrawStyle = elhsOwnerDraw) or (FOwner.FOwnerDrawByColumn and Assigned(LHeaderSection) and (LHeaderSection.Style = elhsOwnerDraw)))
or (not FOwner.FOwnerDrawByColumn and (LCell.Text = FOwner.OwnerDrawMask)) then
begin
if Assigned(FOwner.FOnCellDraw) then
FOwner.FOnCellDraw(FOwner, LCell, ACanvas, R);
end
else
If the style = OwnerDraw then only OnCellDraw will be called. OnItemDraw never.
If I add the condition "and (not Assigned(FOwner.FOnItemDraw))" the grid-lines are there, OnItemDraw will be called in ElXTreeCell. Perfect.
There is no way to set a column to OwnerDraw that the OnItemDraw-event will be fired.
Best regards
Andre Engelshove