Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic ResourceView separation line (Read 3875 times)
Bakeneko
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 3
Joined: Mar 15th, 2013
ResourceView separation line
Jan 10th, 2014 at 11:47am
Print Post  
Hi,

Is there a simple way, in resource view, to add a separation line between two contacts ?

Regards,

Stéphane
  

planning.png (Attachment deleted)
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: ResourceView separation line
Reply #1 - Jan 10th, 2014 at 1:00pm
Print Post  
You have to rely on custom drawing to achieve this. Set Calendar.CustomDraw to ResourceViewRowHeader | ResourceViewCellComplete and handle the Calendar.Draw event. The first flag indicates that the Draw event will be raised for the row headers, the second indicates that the event will be raised for the cells in the view lanes. The idea is to draw a line at the bottom of the bounding rectangle of the custom drawn element. However, you need to take into consideration the fact that the event will be raised for secondary resource as well. For example, you need to draw the line for all primary resources, but only for the last secondary resources. Assuming that your primary resources are Contact objects and your secondary resources are Resource objects, the following code illustrates how to do this:

Code
Select All
void calendar_Draw(object sender, DrawEventArgs e)
{
    if (e.Resource is Contact || calendar.Resources.IndexOf(e.Resource) == calendar.Resources.Count - 1)
        e.Graphics.DrawLine(Pens.Black, e.Bounds.Left, e.Bounds.Bottom - 1, e.Bounds.Right, e.Bounds.Bottom - 1);
} 


Let me know if this helps.

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


I Love MindFusion!

Posts: 3
Joined: Mar 15th, 2013
Re: ResourceView separation line
Reply #2 - Jan 10th, 2014 at 2:41pm
Print Post  
Thanks !

Another question : Is there a setting to specify row margin/padding ?
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: ResourceView separation line
Reply #3 - Jan 10th, 2014 at 3:19pm
Print Post  
Hi,

You can use the Calendar.ItemSettings.Padding property to set the item margins on all four sides or the PaddingLeft, PaddingTop, PaddingRight and PaddingBottom properties to set the margin individually on each side.

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