Notifications
Clear all
[Closed] DevX XtraTreeList Column Header Style
Dec 07, 2014 2:39 pm
Hi there.
I have a question about DevExpress xtraTreeList Column Header appearance.
Can I replace the default Header style and color?
I tried to override cell style and also column forecolor – it works.
But I can’t paint the column header which has “amazing” pinky/yellow color.
Reference Here: Howto custom paint…
Code:
(
try (Scform.CLose()) catch()
tstcol = (dotnetclass "System.drawing.color").lawngreen
Brush = (dotnetclass "Drawing.Brushes").red
ScForm = dotnetobject "MaxCustomControls.Maxform"
ScForm.StartPosition = ScForm.StartPosition.Manual
ScForm.Location = dotnetObject "System.Drawing.Point" 200 200
ScForm.ClientSize = dotnetobject "System.Drawing.Size" 300 120
ScForm.FormBorderStyle = ScForm.FormBorderStyle.Sizable
lv = dotnetobject "DevExpress.xtraTreeList.treeList"
Lv.Location = dotnetObject "System.Drawing.Point" 2 2
Lv.ClientSize = dotnetobject "System.Drawing.Size" ScForm.ClientSize.width ScForm.ClientSize.height
lv.OptionsView.ShowRoot = lv.OptionsView.ShowIndicator = off
headers = #("Update"," Count","Surface")
lv.ClearNodes()
colCount = headers.count
for k=1 to colCount do
(
col = lv.columns.add()
col.visible = on
col.caption = headers[k]
)
arrnodes = #("Node1","Node2","Node3","Node4","Node5")
Lv.BeginUnboundLoad()
for i = 1 to arrnodes.count do
(
nod = lv.appendNode #("1","2","3") -1
)
lv.EndUnboundLoad()
fn FnHeaderCol sender e = -- COLUMN HEADER DRAW (DONT WORK)
(
try (e.Graphics.FillRectangle Brush e.Bounds) catch (format "ERROR -%
" (getCurrentException()))
)
fn FnCellStyle sender e = ---CELL DRAW
(
try (if e.column.AbsoluteIndex != 1 then (e.Appearance.BACKcolor = tstcol)) catch (format "ERROR -%
" (getCurrentException()))
)
ScForm.controls.add lv
dotNet.addEventHandler lv "NodeCellStyle" FnCellStyle --custom CELL style
dotNet.addEventHandler lv "CustomDrawColumnHeader" FnHeaderCol --custom COLUMN style
ScForm.showmodeless()
)