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

Resource not visible or not there at all

4 Answers 98 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Zaynoun ElFalou
Top achievements
Rank 1
Zaynoun ElFalou asked on 06 Aug 2012, 08:08 PM
In radscheduler i tried to do something like the example: http://demos.telerik.com/aspnet-ajax/scheduler/examples/customizeappointment/defaultcs.aspx 
to show appointments with some of resource information (actually in my case subject is irrelevant, only the resource "program" is important to display).

the problem is that it seems the resources are not binding right, or something else is wrong. I get "none" always, despite the fact that my database hold the value for the resource related. What can be wrong ?

<telerik:RadScheduler ID="RadScheduler1" runat="server" DataDescriptionField="Description"
     DataEndField="end" DataKeyField="id" DataRecurrenceField="RecurenceRule" DataRecurrenceParentKeyField="RecurenceParentId"
     DataSourceID="SqlDataSource1" DataStartField="Start" DataSubjectField="Subject"
     EnableDescriptionField="True" OnAppointmentDataBound="RadScheduler1_AppointmentDataBound"
     SelectedView="WeekView">
     <ResourceTypes>
         <telerik:ResourceType DataSourceID="SqlDataSource2" ForeignKeyField="Programid" KeyField="id"
             Name="Program" TextField="programName" />
     </ResourceTypes>
     <ResourceStyles>
         <telerik:ResourceStyleMapping ApplyCssClass="rsCategoryBlue" Key="Programid" Text="Program"
             Type="Program" />
     </ResourceStyles>
     <AppointmentTemplate>
         <div>
             <%#Eval("Subject") %></div>
         <hr />
         <div>
             <asp:Label ID="UserLabel" runat="server" Text=' <%# Container.Appointment.Resources.GetResourceByType("Program") == null ? "None" : Container.Appointment.Resources.GetResourceByType("Program").Text%>' />
         </div>
     </AppointmentTemplate>
 </telerik:RadScheduler>
 <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:radiomixConnectionString %>"
     SelectCommand="SELECT * FROM [Program]"></asp:SqlDataSource>
 <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:radiomixConnectionString %>"
     DeleteCommand="DELETE FROM [ProgramTimes] WHERE [id] = @id" InsertCommand="INSERT INTO [ProgramTimes] ([Subject], [Start], [end], [Description], [RecurenceRule], [RecurenceParentId], [Programid]) VALUES (@Subject, @Start, @end, @Description, @RecurenceRule, @RecurenceParentId, @Programid)"
     SelectCommand="SELECT [id], [Subject], [Start], [end], [Description], [RecurenceRule], [RecurenceParentId], [Programid] FROM [ProgramTimes]"
     UpdateCommand="UPDATE [ProgramTimes] SET [Subject] = @Subject, [Start] = @Start, [end] = @end, [Description] = @Description, [RecurenceRule] = @RecurenceRule, [RecurenceParentId] = @RecurenceParentId, [Programid] = @Programid WHERE [id] = @id">
     <DeleteParameters>
         <asp:Parameter Name="id" Type="Int32" />
     </DeleteParameters>
     <InsertParameters>
         <asp:Parameter Name="Subject" Type="String" />
         <asp:Parameter Name="Start" Type="DateTime" />
         <asp:Parameter Name="end" Type="DateTime" />
         <asp:Parameter Name="Description" Type="String" />
         <asp:Parameter Name="RecurenceRule" Type="String" />
         <asp:Parameter Name="RecurenceParentId" Type="Int32" />
         <asp:Parameter Name="Programid" Type="Int32" />
     </InsertParameters>
     <UpdateParameters>
         <asp:Parameter Name="Subject" Type="String" />
         <asp:Parameter Name="Start" Type="DateTime" />
         <asp:Parameter Name="end" Type="DateTime" />
         <asp:Parameter Name="Description" Type="String" />
         <asp:Parameter Name="RecurenceRule" Type="String" />
         <asp:Parameter Name="RecurenceParentId" Type="Int32" />
         <asp:Parameter Name="Programid" Type="Int32" />
         <asp:Parameter Name="id" Type="Int32" />
     </UpdateParameters>
 </asp:SqlDataSource>

4 Answers, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 08 Aug 2012, 03:08 PM
Hello,

 I have reviewed the code that you pasted and created a sample project based on our on-line demo that worked properly at my side. You can compare it with your project and check our if something is not implemented correctly.

I hope this will help you.


Regards,
Boyan Dimitrov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Zaynoun ElFalou
Top achievements
Rank 1
answered on 08 Aug 2012, 07:57 PM
The database version is 661, i have 655, no downgrade available. this is what the website gave me. Can you provide me with database version 2008 so i can test with it ?

Thanks
0
Boyan Dimitrov
Telerik team
answered on 10 Aug 2012, 02:19 PM
Hello,

You can use the attached script file to create Telerik database through Management Studio and it will be valid and ready to use.  Here you can find instructions about adding RadScheduer required  tables to an existing database. Keep in mind that I am assuming that your database's name is Telerik and script file will use it.

I hope you will find the information provided useful.

Greetings,
Boyan Dimitrov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Zaynoun ElFalou
Top achievements
Rank 1
answered on 11 Aug 2012, 09:23 AM
My problem was because of use of different sql data type between Program.id(bigint) and ProgramTimes.Programid(int). I notice the problem after i tried to make a foreign key relation wish SSMS didn't let me create. Thanks
Tags
Scheduler
Asked by
Zaynoun ElFalou
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Zaynoun ElFalou
Top achievements
Rank 1
Share this question
or