This is a migrated thread and some comments may be shown as answers.

multi resource not saving ?

8 Answers 158 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
jeff357
Top achievements
Rank 2
jeff357 asked on 28 Oct 2011, 11:23 PM
Hi ALL,
   I am in need of some assistance. Software config first..
Win 7 Ult 64, Visual Studio 2010 (VB.NET 2.0, Winforms
Scheduler Q2 2011.2.831 (Latest), VistaDB (Supported
by Telerik ORM) MS SQL 200X Compatible. I have now
"Bound" the Scheduler and I can Create new appoint
ments but save makes the "Appointments" disapear!.
Has anyone ran across this with RadScheduler? (I am
not using ORM) Just the sample .mdb database (used
by telerik example) Converted to VistaDB Format. I
added "User 1", "User2", "User 3", "User 4". to the
resources part of the database and they come up
properly but I Can't figure out the Colors Part Need
Color.Transparent in all 4 spots. I am using the code
"Ivan" Provided and it is in the samples. The "Samples"
do not provide Multi - User Data Binding. It could be a
very simple line of code to solve this problem.
                                                 Thanks in advance!,
                                                                Jeff  :)     
Dim colors() As Color = {Color.Transparent, Color.Transparent, Color.Transparent, Color.Transparent}
           Dim names() As String = {"User 1", "User 2", "User 3", "User 4"}
           For i As Integer = 0 To names.Length - 1
               Dim resource As New Telerik.WinControls.UI.Resource()
               resource.Id = New EventId(i)
               resource.Name = names(i)
               resource.Color = colors(i)
               'resource.Image = Me.imageList1.Images(i)
               Me.RadScheduler1.Resources.Add(resource)
           Next i
           Me.RadScheduler1.GroupType = GroupType.Resource
           Me.RadScheduler1.ActiveView.ResourcesPerView = 2
       Catch ex As Exception

8 Answers, 1 is accepted

Sort by
0
Ivan Todorov
Telerik team
answered on 02 Nov 2011, 01:32 PM
Hello Jeff,

Please find your answer in the support thread named "Multi-User Problem Example".

Should you need further assistance, do not hesitate to contact us.

Best wishes,
Ivan Todorov
the Telerik team

Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

0
nc
Top achievements
Rank 1
answered on 24 Jan 2012, 02:13 PM
You have the same problem as mine . The problem is that Resources are not saved , so when you group it according to recourses
nothing is displayed . if you remove the grouping you can see the records with no resource . Let me know If you found a solution . 
0
Ivan Todorov
Telerik team
answered on 27 Jan 2012, 10:32 AM
Hi nc,

Thank you for writing.

Usually, this is caused by incorrectly set mappings when binding RadScheduler to a data source. The solution to this may vary depending on the details of your case, but generally when using a many-to-many relation between appointments and resources, you should set the Resources property of the AppointmentMappingInfo to the name of the relation and the ResourceId property to the name of the resources column in your intermediate table:
appointmentMappingInfo.Resources = "Appointments_AppointmentsResources"
appointmentMappingInfo.ResourceId = "ResourceID"

More information can be found in the Data Binding Walkthrough help article.

If you send me a code snippet or a sample project that demonstrates your approach, I will be able to provide you with more concrete answers.

I hope you find this helpful.

All the best,
Ivan Todorov
the Telerik team

SP1 of Q3’11 of RadControls for WinForms is available for download (see what's new).

0
George
Top achievements
Rank 1
answered on 03 Dec 2012, 07:06 PM
Hi, my resources color & image are showing. However the image full height is not visible and neither is the ResourceName. Again, I can see part of the image. Is there a way of increasing the resource container row height? Mine is about .25 inch & I need it to be about 1 inch. I'm using RadScheduler Q2 2012 for WinForms. My resources are stored in an SQL table named Resources and bound to the scheduler.
Thanks for any help. medbiller@coqui.net
0
Ivan Todorov
Telerik team
answered on 06 Dec 2012, 02:39 PM
Hi George,

You can use the following method to set the height of the resource header:
private void SetHeaderHeight()
{
    SchedulerDayViewGroupedByResourceElement dayView = this.radScheduler1.SchedulerElement.ViewElement as SchedulerDayViewGroupedByResourceElement;
    SchedulerMonthViewGroupedByResourceElement monthView = this.radScheduler1.SchedulerElement.ViewElement as SchedulerMonthViewGroupedByResourceElement;
    TimelineGroupingByResourcesElement timelineView = this.radScheduler1.SchedulerElement.ViewElement as TimelineGroupingByResourcesElement;
    if (dayView != null)
    {
        dayView.ResourceHeaderHeight = 160;
    }
    if (monthView != null)
    {
        monthView.ResourceHeaderHeight = 160;
    }
    if (timelineView != null)
    {
        timelineView.ResourceHeaderWidth = 160;
    }
}

Note that if you are switching between the views, then you should handle the ActiveViewChanged event and call that method to update the header height of the new view:
void radScheduler1_ActiveViewChanged(object sender, SchedulerViewChangedEventArgs e)
{
    SetHeaderHeight();
}

Hope this helps.

Greetings,
Ivan Todorov
the Telerik team
Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
0
George
Top achievements
Rank 1
answered on 17 Dec 2012, 01:35 PM

Ivan, thanks for your prompt & assertive response.

 

I can manage the Day & Month views pretty well using  the code you supplied, but the Time  line gives the following error:

 

An exception of type 'System.ObjectDisposedException' occurred in mscorlib.dll and wasn't handled before a managed/native boundary

 

Additional information: Cannot access a closed Stream.

 

If I set timelineView.ResourceHeaderWidth = between 0 & 22 on a maximized form it won’t give the error but it’ll show very little of the image. Values for timelineView.ResourceHeaderWidth range from 0 to 2 without error when the form is not maximized.

 

Also I couldn’t find a SchedulerWeekViewGroupedByResourceElement class to implement the same technique for the week view.  Thanks again.

0
Ivan Todorov
Telerik team
answered on 20 Dec 2012, 11:17 AM
Hello George,

I was not able to reproduce the described exception. However, we have encountered some weird exceptions when setting resource images to TimelineView. As far as we know, the cause is an issue in the GDI+ rendering engine and it is triggered because in TimelineView, the images are rotated. To overcome the issue, simply call:
this.radScheduler1.SchedulerElement.SetResourceHeaderAngleTransform(SchedulerViewType.Timeline, 0);
after you bind the scheduler. If this does not help, can you please provide a full stack trace of the exception. This might help in isolating the issue.

As to the SchedulerWeekViewGroupedByResourceElement, there is no such element because the WeekView uses the SchedulerDayViewGroupedByResourceElement with day count of 7. This was implemented this way because the appearance of DayView and WeekView is very similar. The snippet provided in my previous post should work for both views.

Let me know if I can assist you further.

Kind regards,
Ivan Todorov
the Telerik team
Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
0
George
Top achievements
Rank 1
answered on 20 Dec 2012, 02:03 PM
Ivan, it worked great, using VS2010 & Win 7 Pro. Thanks.
Tags
Scheduler and Reminder
Asked by
jeff357
Top achievements
Rank 2
Answers by
Ivan Todorov
Telerik team
nc
Top achievements
Rank 1
George
Top achievements
Rank 1
Share this question
or