Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Can I set the Resource Header Back Colour? (Read 5098 times)
Rob Branaghan
YaBB Newbies
*
Offline


I Love 2 Code!!

Posts: 16
Location: Warwickshire, England
Joined: Jan 6th, 2012
Can I set the Resource Header Back Colour?
Feb 8th, 2012 at 1:26pm
Print Post  
Hi Meppy,

Is it possible to do the following for that Lane only??

Code
Select All
 GanttChartControl.ResourceViewSettings.Style.HeaderBrush = myresource.CustomBrushes.PrimaryBrush; 



Because I need to make the Header row have the same colour as the lane, but the lanes can be different colours.
  

Robert Branaghan
.NET Software Developer
FactoryMaster Ltd.
Back to top
WWW  
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Can I set the Resource Header Back Colour?
Reply #1 - Feb 8th, 2012 at 1:56pm
Print Post  
Unfortunately this is not possible out of the box, you need to rely on custom drawing. Set the Calendar.CustomDraw property to CustomDrawElements.ResourceViewRowHeader then handle the Calendar.Draw event and perform the necessary drawing. However, because the event is raised after the header's default appearance is drawn, you will have to repaint the header text too.

Regards,
Meppy
  
Back to top
 
IP Logged
 
Rob Branaghan
YaBB Newbies
*
Offline


I Love 2 Code!!

Posts: 16
Location: Warwickshire, England
Joined: Jan 6th, 2012
Re: Can I set the Resource Header Back Colour?
Reply #2 - Feb 9th, 2012 at 1:38pm
Print Post  
Do you have any code examples that can do this?
  

Robert Branaghan
.NET Software Developer
FactoryMaster Ltd.
Back to top
WWW  
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Can I set the Resource Header Back Colour?
Reply #3 - Feb 9th, 2012 at 3:15pm
Print Post  
Check the attached sample.

Regards,
Meppy
  

_sample_ResourceViewPaintHeaders.zip (Attachment deleted)
Back to top
 
IP Logged
 
Rob Branaghan
YaBB Newbies
*
Offline


I Love 2 Code!!

Posts: 16
Location: Warwickshire, England
Joined: Jan 6th, 2012
Re: Can I set the Resource Header Back Colour?
Reply #4 - Feb 15th, 2012 at 4:04pm
Print Post  
Brilliant!

Now all I wonder is can I put some style to it? because I would like to have almost a Drop Shadow or gradient colour.

Can this be done? and How?
  

Robert Branaghan
.NET Software Developer
FactoryMaster Ltd.
Back to top
WWW  
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Can I set the Resource Header Back Colour?
Reply #5 - Feb 16th, 2012 at 7:29am
Print Post  
The above sample paints the header with the CustomBrushes.PrimaryBrush property of its associated Resource. To paint the header with gradient, simply assign a gradient brush to this property (or customize the custom drawing code to use a gradient brush directly). Drawing a shadow outside of the header's bounding rectangle shouldn't be a problem because there is no clipping at the time the header is custom drawn.

Regards,
Meppy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint