Page Index Toggle Pages: 1 [2]  Send TopicPrint
Hot Topic (More than 10 Replies) multiple resource selection (Read 8578 times)
fabiogiustini
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 17
Joined: Sep 26th, 2007
Re: multiple resource selection
Reply #15 - Oct 5th, 2007 at 3:17pm
Print Post  
Ok, Meppy than you !!

1) abot custom draw i've updated the code in Calendar.Draw event of your saple this way:

}
else if (start <= selStart && selEnd <= end)
{
// The selection is completely contained in the cell
g.FillRectangle(brush, b);

}
else if (selStart < start && start < selEnd)
{
// The selection starts before this cell and
// ends within this cell
g.FillRectangle(brush, b);

}
else if (selStart < end && end < selEnd)
{
// The selection starts within the cell and
// ends after the cell
g.FillRectangle(brush, b);

So now i drow a rectangle in all cell also in case of partial selection.

However when I create the item, the startdate and the end date are those of the  selection below the designed rectangle: how  can i set the selection snap  to all day?



2) After creating the item associated with all selected resource, if i move it to another resource (by dragging in the calendar control) obviusly it will be asociated only to resource that i've moved to. So: how can allow only the drag between dates and not between resources too?

Thanks a lot for your precious support!!
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: multiple resource selection
Reply #16 - Oct 8th, 2007 at 5:40am
Print Post  
You can handle the ItemCreated event and modify the start and end time of the item accordingly, so that the item spans the whole day. Here is a sample code that can give you an idea how to do it:

Code
Select All
DateTime start = e.Item.StartTime;
start = start - start.TimeOfDay;
e.Item.StartTime = start;

DateTime end = e.Item.EndTime;
if (end.TimeOfDay.Ticks != 0)
{
	end = end + (TimeSpan.FromDays(1) - end.TimeOfDay);
	e.Item.EndTime = end;
} 


As for the item resources being reassigned when the item is dragged, I can't really think of an easy way to avoid this yet. Maybe we can implement a new feature in the next release that could prevents this from happening.

Meppy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint