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

Resource Collection in RadScheduler

46 Answers 1345 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
anu
Top achievements
Rank 1
anu asked on 24 Dec 2007, 07:35 PM
Hi All,

I use RadScheduler in my application...created resource collection and populated with some data.....but in the drop down by default the first list item is dispalyed as '-' which I dont want. Because if we insert appointment by selecting '-' in the resource type, null value is inserted into the database in that particular cell. So, please let me know how to delete that '-' from the list items.

Thanks

46 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 27 Dec 2007, 11:51 AM
Hello Anu,

This behavior is by design. If no resource of a specific type is associated with the appointment, the "-" option is selected for the dropdown list. You can use Templates to change the default behavior. If you specify what exactly should happen in the case when no resource of a certain type is associated with the appointment, we will provide with a solution.



Kind regards,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
anu
Top achievements
Rank 1
answered on 27 Dec 2007, 02:27 PM
Hi Peter,

Thank you for the reply.
In that case, if the user dont select any resource and clicks submit, then a message should be displayed saying that "Please select...."(its like requiredfield validator) and also the appointment insertion should be cancelled.

Regards
0
Peter
Telerik team
answered on 27 Dec 2007, 04:49 PM
Hi Anu,

Thanks for clarifying. You can try the following solution:

 <telerik:RadScheduler ID="RadScheduler1" runat="server"   
           OnAppointmentInsert="RadScheduler1_AppointmentInsert" 
          OnAppointmentUpdate="RadScheduler1_AppointmentUpdate">  
            <ResourceTypes> 
                <telerik:ResourceType DataSourceID="SqlDataSource2" ForeignKeyField="UserID" KeyField="ID" 
                    Name="Users" TextField="UserName" /> 
            </ResourceTypes> 
        </telerik:RadScheduler> 


protected void RadScheduler1_AppointmentInsert(object sender, Telerik.Web.UI.SchedulerCancelEventArgs e)  
    {  
        if (e.Appointment.Resources.GetResourceByType("Users") == null)  
        {  
            Response.Write("Please, select a user.");  
            e.Cancel = true;          
        }  
    }  
protected void RadScheduler1_AppointmentUpdate(object sender, Telerik.Web.UI.AppointmentUpdateEventArgs e)  
    {  
        if (e.ModifiedAppointment.Resources.GetResourceByType("Users") == null)  
        {  
            Response.Write("Please, select a user.");  
            e.Cancel = true;  
        }  
    } 




All the best,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
anu
Top achievements
Rank 1
answered on 27 Dec 2007, 07:29 PM
Hi Peter,

Thank you for ur support....its working(ofcourse if we write response.write(), its throwing error, so replaced with msgBox()).

I also want to know whether we can insert radiobuttons or textboxes in that appointment filling form(may be in the resource collection or may be outside the resource collection in the RadScheduler)
0
Peter
Telerik team
answered on 28 Dec 2007, 10:54 AM
Hi Anu,

Here is an example. Please, consider the Database Scheduler Provider example and try the following code with it:

 <AdvancedEditTemplate> 
                <asp:TextBox ID="TitleTextBox" Rows="5" Columns="20" runat="server" Text='<%# Bind("Subject") %>' 
                    Width="95%" TextMode="MultiLine"></asp:TextBox> 
                <div style="position: relative">  
                    <span>Teachers:</span><br /> 
                    <asp:CheckBoxList ID="TeachersCheckBoxList" runat="server">  
                    </asp:CheckBoxList> 
                </div> 
                <br /> 
                <br /> 
                <div> 
                    <span>Students:</span><br /> 
                    <asp:CheckBoxList ID="StudentsCheckBoxList" runat="server">  
                    </asp:CheckBoxList> 
                </div> 
                <asp:LinkButton ID="UpdateButton" runat="server" Text="Update" CommandName="Update" /> 
            </AdvancedEditTemplate> 

protected void RadScheduler1_FormCreated(object sender, SchedulerFormCreatedEventArgs e)  
        {  
            
            CheckBoxList teachers = (CheckBoxList)e.Container.FindControl("TeachersCheckBoxList");  
                 
               foreach (Resource r in RadScheduler1.Resources.GetResourcesByType("Teacher"))  
                {  
                   ListItem listitem1 = new ListItem(r.Text, r.Key.ToString());  
                   listitem1.Selected = ResourceIsInUse(r, e.Appointment);  
                   teachers.Items.Add(listitem1);  
                    
                }  
                CheckBoxList students = (CheckBoxList)e.Container.FindControl("StudentsCheckBoxList");  
 
                foreach (Resource r in RadScheduler1.Resources.GetResourcesByType("Student"))  
                {  
                    ListItem listitem1 = new ListItem(r.Text, r.Key.ToString());  
                    listitem1.Selected = ResourceIsInUse(r, e.Appointment);  
                    students.Items.Add(listitem1);  
                    
                }  
   
             
        }  
        private bool ResourceIsInUse(Resource res, Appointment a)  
        {  
            foreach (Resource appRes in a.Resources)  
            {  
                if (res == appRes)  
                {  
                    return true;  
                }  
            }  
 
            return false;  
        }  
        protected void RadScheduler1_AppointmentCommand(object sender, AppointmentCommandEventArgs e)  
        {  
            CheckBoxList teachers = (CheckBoxList)e.Container.FindControl("TeachersCheckBoxList");  
            CheckBoxList students = (CheckBoxList)e.Container.FindControl("StudentsCheckBoxList");  
            e.Container.Appointment.Resources.Clear();  
              
              
                foreach (ListItem item1 in teachers.Items)  
                {  
                    if (item1.Selected)  
                    {  
                        Resource teacher = RadScheduler1.Resources.GetResource("Teacher"int.Parse(item1.Value));  
                        e.Container.Appointment.Resources.Add(teacher);  
                    }    
                }  
             
               foreach (ListItem item1 in students.Items)  
                {  
                    if (item1.Selected)  
                    {  
                        Resource student = RadScheduler1.Resources.GetResource("Student"int.Parse(item1.Value));  
                        e.Container.Appointment.Resources.Add(student);  
                      
                    }                         
                }            
        } 

Let us know if you have any questions.


Regards,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
anu
Top achievements
Rank 1
answered on 28 Dec 2007, 03:53 PM
Hi Peter,

Thank you for the reply.
When I insert radiobuttonlist or text box in AdvancedEditTemplate or AdvancedInsertTemplate, and when I want to insert a appointment, its displaying only the radiobuttonlist or textbox, its not displaying all the fields like description field, start time, end time, resource types.....

I want every thing on the appointment insert form(including radiobutton in the templates), please let me know the procedure.

Also one more question in that appointment insert form, is it possible that if I select one list item in the radiobutton list, then based on that event a new dropdownlist(may be resource type) should be dispalyed?

Regards
0
Peter
Telerik team
answered on 28 Dec 2007, 04:42 PM
Hello Anu,

That's understandable. Sorry for not providing you with a more complete solution. You need to create the other controls using Templates. Please, follow the online example and let us know if you have questions.  


All the best,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
anu
Top achievements
Rank 1
answered on 02 Jan 2008, 03:38 PM
Hi,

Here I have another question, in the normal scheduler, while inserting appointment in the appointment form, if we select recurring appointment check box then other fields like recurrence and range of recurrence gets displayed. Then how this can be achieved using the templates???

My requirement is if given a field with options(radio button list) yes/no....a drop down should be dispalyed when the user selects 'yes'.


0
anu
Top achievements
Rank 1
answered on 03 Jan 2008, 02:08 PM
Please answer my above query at the earliest.

Thanks.
0
anu
Top achievements
Rank 1
answered on 04 Jan 2008, 08:50 PM
Anybody there to answer my query???
It has been 2 working days already but no answer.
0
Peter
Telerik team
answered on 08 Jan 2008, 09:23 AM
Hello Anu,

We understand what you want to achieve and it makes perfect sense. Unfortunately, RadScheduler doesn't support this functionality yet. However, I have discussed your inquiry with our development team and we will consider exposing a template which will allow partial customization of the advanced form, while preserving the functionality related to recurrence and resources.


Kind regards,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Richardsonke
Top achievements
Rank 1
answered on 10 Jan 2008, 08:38 PM
I would like to agree with this request.  Partial customization of the form is very important to us, as we would not like to recreate all of the features of the existing form.
0
Peter
Telerik team
answered on 11 Jan 2008, 03:42 PM
Hello guys,

Thanks for your involvment. We will try to implement this feature as soon as possible.


Regards,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Ville Tenhunen
Top achievements
Rank 1
answered on 26 Mar 2008, 08:06 AM
Hi Peter,

have you allready scheduled this to implementation? We are really waiting for this feature.

Br,

Sami
0
Peter
Telerik team
answered on 26 Mar 2008, 11:09 AM
Hi Sami,

I am glad to inform you that the Customizing the Advanced Template example is already finalized. The accompanying help article is not live yet, so I am sending it to you as a word document.

The user controls can be found in your local installation of of the latest Telerik.Web.UI Futures (attached is a screenshot of which file you need to download) at this location:

Live Demos\Scheduler\Examples\AdvancedFormTemplate\DefaultTemplates

Should you have any questions, please feel free to contact us.



All the best,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Ville Tenhunen
Top achievements
Rank 1
answered on 26 Mar 2008, 11:41 AM
Thank you! That will help us alot!
We'll try implementin it to our software right away.

Br,

Sami
0
Chris Phelps
Top achievements
Rank 1
answered on 31 Jan 2011, 06:32 AM
If a resource is not selected, can we set it in code somehow before the appointment is saved?

In both advanced and regular insert/edit modes?

Without using Templates?
0
Peter
Telerik team
answered on 31 Jan 2011, 04:52 PM
Hello Chris,

Yes, you can handle AppointmentInsert and AppointmentUpdate(e.ModifiedAppointment) to achieve this. For example:
protected void RadScheduler1_AppointmentInsert(object sender, AppointmentInsertEventArgs e)
  {
      if (e.Appointment.Resources.GetResourceByType("User") == null)
          e.Appointment.Resources.Add(new Resource("User", 1, "Alex"));
  }


Regards,
Peter
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Chris Phelps
Top achievements
Rank 1
answered on 31 Jan 2011, 05:18 PM
Perfect, thank you.

I would like to have a second resource, but not let the end user choose the value of that resource.  So I would need the combo box hidden so they don't see an empty combo box on the advancedinsert form.  Is that possible?
0
Peter
Telerik team
answered on 02 Feb 2011, 12:57 PM
Hello Chris,

Yes, you can access the resource RadComboBox in FormCreated and set its Visible property to false. Here is a kb article for reference -

http://www.telerik.com/support/kb/aspnet-ajax/scheduler/how-to-access-controls-in-the-advanced-form.aspx


Kind regards,
Peter
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Chris Phelps
Top achievements
Rank 1
answered on 04 Feb 2011, 08:46 PM
Thank you again, that works!
0
Felipe
Top achievements
Rank 1
answered on 09 Sep 2011, 12:54 AM
Hello!

Going back to the first question: "How to display a message if no resource value is selected"

I want to achieve it with something similar as the SubjectValidator in the AdvancedForm (see attached image).

How can I do that?
0
Felipe
Top achievements
Rank 1
answered on 09 Sep 2011, 03:36 PM
Hello?

Anybody outhere?

I need help!
0
Peter
Telerik team
answered on 13 Sep 2011, 04:56 PM
Hello Felipe,

You can download a sample from the code library that shows amongst many other scenarios how to add a new custom validator for the description field. You can follow the approach and adapt it for a resource validation as well.

Greetings,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
v-govinr@microsoft.com
Top achievements
Rank 1
answered on 20 Sep 2011, 11:39 AM
Hi,

I am trying modify the default edit appointment form using <AdvanceEditTemplate>. After adding controls to this template, when i click any appointment .. Edit form is not opening...simply page is getting refreshed.

code is like this in my  .aspx page,

<telerik:radscheduler ID="RadScheduler1" runat="server" SelectedView="MonthView"
       Font-Bold="False"  Height="485px"
       Width="824px"  EnableEmbeddedBaseStylesheet="true"
       EnableEmbeddedSkins="true" style="margin-right: 16px" 
         Skin="Vista" onformcreated="RadScheduler1_FormCreated" onprerender="RadScheduler1_PreRender"
OnAppointmentCommand="RadScheduler1_AppointmentCommand">
     <MonthView HeaderDateFormat="MMMMMMMM, yyyy"  />
       <Localization HeaderTimeline="Agenda"   />
                  <AdvancedEditTemplate>
               <asp:TextBox ID="TitleTextBox" Rows="5" Columns="20" runat="server"
                   Width="95%" TextMode="MultiLine"></asp:TextBox>
               <div style="position: relative"
                   <span>Teachers:</span><br />
                   <asp:CheckBoxList ID="TeachersCheckBoxList" runat="server"
                   </asp:CheckBoxList>
               </div>
               <br />
               <br />
               <div>
                   <span>Students:</span><br />
                   <asp:CheckBoxList ID="StudentsCheckBoxList" runat="server"
                   </asp:CheckBoxList>
               </div>
               <asp:LinkButton ID="UpdateButton" runat="server" Text="Update" CommandName="Update" />
           </AdvancedEditTemplate>
    </telerik:radscheduler>
At this moment i am not binding any data to controls inside the template. But in future i have to..
Please help me..
0
Peter
Telerik team
answered on 20 Sep 2011, 02:45 PM
Hi V-Govinr@Microsoft.Com,

How do you handle FormCreated?

If the advanced form is modal, please use this topic - http://www.telerik.com/help/aspnet-ajax/scheduler-custom-modal-advanced-template.html.


All the best,
Peter
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
v-govinr@microsoft.com
Top achievements
Rank 1
answered on 21 Sep 2011, 06:02 AM
Hi Peter,

     In the Form created event , I am just binding the data to the controls which are inside Advanced template.

     But ,i hope there is no difference between Advanced template which i have designed and posted in this thread and the example you provided..

    Can you please provide a sample application .. so that it will give better clarity on this.
Thanks ,
Govind.
0
Peter
Telerik team
answered on 21 Sep 2011, 01:20 PM
Hello V-Govinr@Microsoft.Com,

If you use the Advanced Templates, there is no need to handle FormCreated. You can download a sample from here.

Best wishes, Peter
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
Jose
Top achievements
Rank 1
answered on 22 Feb 2012, 01:00 AM

 

Hello

I have a Resource that I'm loading from code. This resource renders as a drop down. (See attached) I want to know if there is a way to access the drop down in the code behind or client side so I can hide or disable the drop down.

Your help will be truly appreciated.

Also you might notice that time and date show is 2 different lines. I'm not Shure why. If you can shed some light on this I’ll appreciate it also

Thank you!

0
Peter
Telerik team
answered on 24 Feb 2012, 02:30 PM
Hello Jose,

You can access controls of the advanced form from code behind in the FormCreated event of RadScheduler. Here is a help topic for more details.

For a client side approach, please see this topic.

Regards,
Peter
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
Scorpy47
Top achievements
Rank 1
answered on 22 Feb 2013, 07:07 AM
Hi,
 I've used the examples given here and it has almost solved all the issues I was facing, except a small bit. I am able to insert a custom resource type by selecting from the drop down into the database, but when I am editing the same appointment, how do I display the resources that I selected while inserting the appointment. for example, the appointment data types like description, location are all displayed automatically, but in regards to the custom resources I am not sure how to display. The drop down displays all the values, but I want to select one that I have preselected and pass it from the database .
In other words..as in the Example below is how I get the values for the dropdown and in my database (through another query) I get the purposeid. I want this purposeid to be selected when I display the edit appointment. Can you please help?

 ResourceType resMeetingRoomPurpose = new ResourceType
                                                     {
                                                      DataSource = DBHelper.GetMeetingRoomPurposes(),
                                                      KeyField = "purposeid",
                                                      ForeignKeyField = "purposeid",
                                                      TextField = "Purpose",
                                                      AllowMultipleValues = false,
                                                      Name = "Purpose"
                                                     };



0
Scorpy47
Top achievements
Rank 1
answered on 25 Feb 2013, 06:24 AM
Guys,
 Any help will be much appreciated. I have used this without templates and I need to preselect only one resource. Please help
0
Plamen
Telerik team
answered on 27 Feb 2013, 07:18 AM
Hi,

 
Since this thread is quite long it is not quite clear which exactly scenario are you implementing. Generally preselecting of the appropriate resource is a functionality that is usually inbuilt in RadScheduler. If you are using Custom Advanced form you will have to implement it as in this on-line demo. You can get the isolated code from this Code Library.

Hope this will be helpful.

All the best,
Plamen
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
Santosh
Top achievements
Rank 1
answered on 25 Oct 2013, 11:24 AM
how to get selected value by default in radschedular dropdownlist from database???? At present Getting "-" by default in radschedular how to over come this issue????
0
Santosh
Top achievements
Rank 1
answered on 25 Oct 2013, 11:28 AM
how to get selected value by default in radscheduler dropdownlist  from database???? At present Getting "-" value default in radscheduler dropdownlist how to over come this issue ???
0
Plamen
Telerik team
answered on 30 Oct 2013, 06:38 AM
Hello,

 
You can use onFormCreated event as it is described in Change the selected index of a resource combobox so always one option is preselected section of this help topic.

Hope this will be helpful.

Regards,
Plamen
Telerik
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 the blog feed now.
0
Santosh
Top achievements
Rank 1
answered on 31 Oct 2013, 12:13 PM
Hi Peter,
I use RadScheduler in my application...created resource collection and populated with some data.....but in the drop down by default the first list item is dispalyed as '-' which I dont want.I want default value irrespective of "-".

just few mins back seen ur reply to this kind of issue
This behavior is by design. If no resource of a specific type is associated with the appointment, the "-" option is selected for the dropdown list. (posted on dec 27 2007) ...... got any solution to this issue . 

0
Santosh
Top achievements
Rank 1
answered on 05 Nov 2013, 05:17 AM
4 Days up no reply to my issue .... kindly give some reply to above issue.... i had been posted on 31/10/2013 till now no reply .... waiting for the reply.
0
Plamen
Telerik team
answered on 05 Nov 2013, 08:12 AM
Hello,

 
I am attaching a sample web page where similar behavior is implemented. Hope this will be helpful.

I would also like to recommend you if you are having a urgent issue connected with RadControls to use your support tickets system.

Regards,
Plamen
Telerik
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 the blog feed now.
0
Santosh
Top achievements
Rank 1
answered on 05 Nov 2013, 11:00 AM
Thanks For The Reply ..... we are using radresource in radschedular but not radcombobox. radschedular is not accepting radcombobox.Give samples in Radresource instead of radcombobox for getting default value instead of "-".


0
Plamen
Telerik team
answered on 07 Nov 2013, 12:04 PM
Hello Santosh,

 
It is not clear what do you mean by "using radresource". Would you please share which exactly scenario and binding from our on-line demos are you using so we could provide solution?

Regards,
Plamen
Telerik
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 the blog feed now.
0
Santosh
Top achievements
Rank 1
answered on 07 Nov 2013, 01:36 PM
Hello Admin,
                    Thanks For the Reply my issue is u had attached sample file on 5th of this month which consists of radcombobox in radschedualr but we are using "ResourceType" in Radschedular by this we are getting "-" value default in "ResourceType" we don't want such "-" value default.Instead of  "-" value we want "ACTIVE" value to be placed default in radschedular using radresouce type but not with radcombobox.

0
Plamen
Telerik team
answered on 11 Nov 2013, 11:09 AM
Hi Santosh,

 
Unfortunately I could not find any attached file and it is still not clear what is the difference of the scenario that you are implementing.  Would you please elaborate is you using AdvancedTemplate scenario or the default insert/update form?

Regards,
Plamen
Telerik
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 the blog feed now.
0
Santosh
Top achievements
Rank 1
answered on 12 Nov 2013, 12:09 PM
Hello Admin,
Attached File Named as :changeResourceDefaultValue.Zip dated on 5th of this month(In This Page only). AttachedFile consists of radcombobox in radschedualr but we are using "ResourceType" in Radschedular by this we are getting "-" value default in "ResourceType" we don't want such "-" value default.Instead of  "-" value we want "ACTIVE" value to be placed default in radschedular using radresouce type but not with radcombobox.
0
Plamen
Telerik team
answered on 12 Nov 2013, 12:46 PM
Hi,

 
Now  I think the scenario a bit more clear.

 In your case you are defining the resources from the mark up as in this on-line demo while in the project I attached it was done from a custom provider. The only difference that have to be done in the code is that instead of "ResRoom" you should find the control in the code behind by using "Res"+ Yuur ResourceType Name. This should let you find the correct RadComboBox in the advanced form and change the text of the selected item according to your scenario.

Regards,
Plamen
Telerik
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 the blog feed now.
0
Manikandan
Top achievements
Rank 1
answered on 07 Oct 2015, 01:00 PM

hi i am using radscheduler, while i am created new appointment template, The template inside subject and Start Date End Date, CheckboxList radcombobox isthere,  tow type of checked option if i clicked checkbox1 i want load radcombobox in checkbox1 related data at same time i clicked checkbox2 i want load radcombobox in checkbox2 related data

Please help me 

 

 

 

 

Tags
Scheduler
Asked by
anu
Top achievements
Rank 1
Answers by
Peter
Telerik team
anu
Top achievements
Rank 1
Richardsonke
Top achievements
Rank 1
Ville Tenhunen
Top achievements
Rank 1
Chris Phelps
Top achievements
Rank 1
Felipe
Top achievements
Rank 1
v-govinr@microsoft.com
Top achievements
Rank 1
Jose
Top achievements
Rank 1
Scorpy47
Top achievements
Rank 1
Plamen
Telerik team
Santosh
Top achievements
Rank 1
Manikandan
Top achievements
Rank 1
Share this question
or