This question is locked. New answers and comments are not allowed.
Hi ,
i am trying multiple resource selection in schedulerview but it default all resource selected in listbox,
this project developed in MVVM patter
i have modify the resource class and Appointment Class modify as task.
Please check
ResourceTypeCollection resourcetypecollection = new ResourceTypeCollection();
ResourceType resourcetype = new ResourceType("Employee");
resourcetype.AllowMultipleSelection = true;
CalendarResource resource;
Task appintmentDetail=new Task();
AddListDetails();
foreach (var item in EmployeeByGroupDetailList)
{
// resource = new Resource(item.Name) { };
resource = new CalendarResource()
{
DisplayName = item.Name,
ResourceName=item.Name,
ResourceId=(long)item.AuthorizedUserId,
GroupID = EmployeeTaskGroupDetails.EmployeeTaskGroupId,
};
resourcetype.Resources.Add(resource);
foreach (var itemdetails in SchedulerDetailsList)
{
if (itemdetails.AuthorizedUserId.Equals(item.AuthorizedUserId))
{
appintmentDetail = new Task()
{
Subject = itemdetails.task,
Start = Convert.ToDateTime(itemdetails.StartTime),
End = Convert.ToDateTime(itemdetails.EndTime),
Category = new Category()
{
CategoryName = itemdetails.TaskType,
DisplayName = CategoryTypeCategoryName(itemdetails.TaskType),
CategoryBrush = CategoryTypeBrush(itemdetails.TaskType),
},
Amount = Convert.ToDecimal(4564.213),
Completed = Convert.ToBoolean(itemdetails.completed),
GroupId = EmployeeTaskGroupDetails.EmployeeTaskGroupId,
EmployeeTaskID = itemdetails.refId,
RecurringEvent = Convert.ToBoolean(itemdetails.REcurringEvent),
Reoccurs = new ReoccursDetails()
{
ReoccursDisplayName = itemdetails.Recur,
ReoccursName = itemdetails.Recur
},
JobID=(long?)itemdetails.jobid??0,
JobNumberText=itemdetails.JobNumber,
LocalUniqueCurrentID=itemdetails.LocalUniqueID,
};
appintmentDetail.Resources.Add(resource);
this.Appointments.Add(appintmentDetail);
}
}
}
resourcetypecollection.Add(resourcetype);
OnPropertyChanged("Appointments");
this.ResourceTypes = resourcetypecollection;
this.Isloading = false;
i am trying multiple resource selection in schedulerview but it default all resource selected in listbox,
this project developed in MVVM patter
i have modify the resource class and Appointment Class modify as task.
Please check
ResourceTypeCollection resourcetypecollection = new ResourceTypeCollection();
ResourceType resourcetype = new ResourceType("Employee");
resourcetype.AllowMultipleSelection = true;
CalendarResource resource;
Task appintmentDetail=new Task();
AddListDetails();
foreach (var item in EmployeeByGroupDetailList)
{
// resource = new Resource(item.Name) { };
resource = new CalendarResource()
{
DisplayName = item.Name,
ResourceName=item.Name,
ResourceId=(long)item.AuthorizedUserId,
GroupID = EmployeeTaskGroupDetails.EmployeeTaskGroupId,
};
resourcetype.Resources.Add(resource);
foreach (var itemdetails in SchedulerDetailsList)
{
if (itemdetails.AuthorizedUserId.Equals(item.AuthorizedUserId))
{
appintmentDetail = new Task()
{
Subject = itemdetails.task,
Start = Convert.ToDateTime(itemdetails.StartTime),
End = Convert.ToDateTime(itemdetails.EndTime),
Category = new Category()
{
CategoryName = itemdetails.TaskType,
DisplayName = CategoryTypeCategoryName(itemdetails.TaskType),
CategoryBrush = CategoryTypeBrush(itemdetails.TaskType),
},
Amount = Convert.ToDecimal(4564.213),
Completed = Convert.ToBoolean(itemdetails.completed),
GroupId = EmployeeTaskGroupDetails.EmployeeTaskGroupId,
EmployeeTaskID = itemdetails.refId,
RecurringEvent = Convert.ToBoolean(itemdetails.REcurringEvent),
Reoccurs = new ReoccursDetails()
{
ReoccursDisplayName = itemdetails.Recur,
ReoccursName = itemdetails.Recur
},
JobID=(long?)itemdetails.jobid??0,
JobNumberText=itemdetails.JobNumber,
LocalUniqueCurrentID=itemdetails.LocalUniqueID,
};
appintmentDetail.Resources.Add(resource);
this.Appointments.Add(appintmentDetail);
}
}
}
resourcetypecollection.Add(resourcetype);
OnPropertyChanged("Appointments");
this.ResourceTypes = resourcetypecollection;
this.Isloading = false;