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

ResourceType & GroupBy error

4 Answers 95 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Piyush Bhatt
Top achievements
Rank 2
Piyush Bhatt asked on 15 Jan 2008, 10:46 PM

I have a sample RadScheduler as follows. When I put the AdvancedEditTemplate it gives me below error. When I add RadAjaxManager, it gives me error too. If I don't  use RadAjaxManager and AdvancedEditTemplate, it displays the scheduler fine.  What should I do?

Could not find ResourceType selected for grouping. Please, check that the GroupBy attribute is properly set and a ResourceType with the same name exists.

    <telerik:RadScheduler ID="RadScheduler1" runat="server"
        Skin="Office2007"
        SelectedView="ResourceView"
        AllowDelete="False"
        AllowEdit="True"
        AllowInsert="False"
        DataStartField="Start"
        DataEndField="End" DataKeyField="AptId"
        MinutesPerRow="5"
        DataSourceID="AptSource" DataSubjectField="Act"
        FirstDayOfWeek="Sunday" LastDayOfWeek="Saturday"
        OverflowBehavior="Scroll"
        >
        <ResourceTypes>
            <telerik:ResourceType DataSourceID="PhySource"
                    Name="Physician" TextField="Name" KeyField="PhyId"
                    ForeignKeyField="PhyId" />
        </ResourceTypes>
<%--        <AdvancedEditTemplate>
        <asp:Panel ID="pnlEdit" runat="server">
            Patient Name: <asp:TextBox ID="txtName" runat="server" />
            Activity: <asp:TextBox ID="TextBox1" runat="server" />
            Start Time: <asp:TextBox ID="TextBox2" runat="server" />
            End Time: <asp:TextBox ID="TextBox3" runat="server" />
        </asp:Panel>   
        </AdvancedEditTemplate>
--%>        <AppointmentTemplate>
            <asp:Panel ID="pnlSlot" runat="server">
            <span style="background-color:Yellow;">Troy</span>
            <span style="background-color:Blue;">Livonia</span>
            <span style="background-color:Green;">Novi</span>
            </asp:Panel>
        </AppointmentTemplate>
    </telerik:RadScheduler>   


4 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 16 Jan 2008, 09:48 AM
Hello Piyush,

We tried to recreate the problem using your code but withoud success. Everything worked as expected in our local tests. Do you have a working demo project which you can send to us via a support ticket?


Kind regards,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Peter
Telerik team
answered on 16 Jan 2008, 03:26 PM
Hello Piyush,

After further testing, we found that the problem appears only design-time. Other than that, the application compiles and runs as expected. Do you get design-time only error at your side as well?

We will log this problem and try to resolve it as soon as possible. Thanks for your post.


Best wishes,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Piyush Bhatt
Top achievements
Rank 2
answered on 17 Jan 2008, 05:23 PM
Seriously! Something is weird! Because to send you code I again opened up that test project and executed and boom - it's working too. I swear I did not change anything since the last time I wrote you.

Anyhow, this is good.

Also, I see 'Resource View' too. But when I display resource view, the 'Day, Week, Month" don't display as buttons. And when I display 'D/W/M' view then 'Resource' does not display as button. Is there a way I can control what buttons to display there?

Other requirement I have is to 'control' whether any appointment can be edited or not and dragged/drop or not. There is a AllowEdit which seems to work globally for the whole scheduler. I need this control for each appointment.

So far, I love this control.

Thanks,
Piyush Bhatt.
0
Peter
Telerik team
answered on 18 Jan 2008, 01:48 PM
Hi Piyush,

When SelectedView = "ResourceView", the buttons for other views are not shown - this is by design. However, we will consider changing this for the Q1 2008 release so that you can control what buttons to display for the various views of RadScheduler.

As for the other question, you can use Custom Attributes and set the AllowEdit property of the appointment in the AppointmentDataBound event as in the following code sample:

 protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)  
    {  
        e.Appointment.AllowEdit = e.Appointment.Attributes["Editable"]; 
          
    } 

I hope this helps. Let us know if you have any other questions.


All the best,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Scheduler
Asked by
Piyush Bhatt
Top achievements
Rank 2
Answers by
Peter
Telerik team
Piyush Bhatt
Top achievements
Rank 2
Share this question
or