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

How to get resourcetype selected value in telerik Rad Scheduler Control.

7 Answers 415 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
DIPAK
Top achievements
Rank 1
DIPAK asked on 03 Jan 2011, 12:49 PM

Hi Sir,


How to get  resourcetype selected value in telerik Rad Scheduler Control.

  


Aspx .page code part:

  <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="200px" Width="300px">
        
          
        
            <telerik:RadScheduler ID="RadScheduler1" runat="server" DataEndField="EndTime" 
                FirstDayOfWeek="Monday" LastDayOfWeek="Friday"
                DataKeyField="ID" SelectedView="WeekView" EnableDescriptionField="True" TimelineView-NumberOfSlots="15"
                DataStartField="StartTime" DataSubjectField="Subject" Width="943px" 
                Height="900px" TimelineView-ShowResourceHeaders="true" 
                DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentKey"
                Skin="WebBlue" onappointmentclick="RadScheduler1_AppointmentClick" 
                AppointmentStyleMode="Default" OnClientAppointmentCreated="appointmentCreated"
                onappointmentdelete="RadScheduler1_AppointmentDelete"  
                onappointmentinsert="RadScheduler1_AppointmentInsert" 
                onappointmentdatabound="RadScheduler1_AppointmentDataBound" 
                onappointmentupdate="RadScheduler1_AppointmentUpdate"  
                OnNavigationComplete="RadScheduler1_NavigationComplete" 
                OnClientAppointmentDoubleClick="OnClientAppointmentDoubleClick" 
                OnFormCreated="RadScheduler1_FormCreated"
                CustomAttributeNames="Call P" EnableCustomAttributeEditing="True"  >

                        <AdvancedForm Modal="true" EnableCustomAttributeEditing="true" EnableResourceEditing="true" />
             <TimelineView GroupBy="Calendar" GroupingDirection="Vertical" />
             <ResourceStyles>
                 <telerik:ResourceStyleMapping Type="Calendar" Text="Development" BackColor="#D0ECBB" BorderColor="#B0CC9B" />
                 <telerik:ResourceStyleMapping Type="Calendar" Text="Marketing" ApplyCssClass="rsCategoryRed" />
                 <telerik:ResourceStyleMapping Type="Calendar" Text="Work" ApplyCssClass="rsCategoryOrange" />
             </ResourceStyles>
         <TimeSlotContextMenuSettings EnableDefault="true" />
         <AppointmentContextMenuSettings EnableDefault="true" /> 
         <ResourceTypes>

           <THIS is section i am binding from Code behind at the page load>
                </ResourceTypes>
    
            </telerik:RadScheduler>         
                </telerik:RadAjaxPanel
>
------------------------------------------

Creating the Static value for Resource type  in Code behind page.... following i aM BINDING AT PAGE LOAD

 ResourceType CallPriority = new ResourceType("Call Priority");
            CallPriority.ForeignKeyField = 
"RoomID"
;
            RadScheduler1.ResourceTypes.Add(CallPriority);
            RadScheduler1.Resources.Add(new 
Resource("Call Priority", 1, "Call1"
));
            RadScheduler1.Resources.Add(new 
Resource("Call Priority", 2, "Call2"
));
            RadScheduler1.Resources.Add(new 
Resource("Call Priority", 3, "Call3"
));
            RadScheduler1.Resources.Add(new 
Resource("Call Priority", 4, "Call4"
));
            RadScheduler1.Resources.Add(new 
Resource("Call Priority", 5, "Call5"
));
            RadScheduler1.Resources.Add(new 
Resource("Call Priority", 6, "Call6"
));
            RadScheduler1.Resources.Add(new 
Resource("Call Priority", 7, "Call7"
));
            RadScheduler1.Resources.Add(new 
Resource("Call Priority", 8, "Call8"
));
            RadScheduler1.Resources.Add(new 
Resource("Call Priority", 9, "Call9"
));
            RadScheduler1.Resources.Add(new 
Resource("Call Priority", 10, "Call10"
));
            RadScheduler1.GroupBy = 
"Call Priority"
;
            RadScheduler1.GroupingDirection = 
GroupingDirection.Vertical;


i AM able to bind with my Drop down as per attached screen shot  but not able to get (Selected value)value after selection of any "CALL1","Call2" 
as per your I am trting to bind with same code we do not have any comboBOX iD..
  

The following code gives me default value of drop down list.

((Telerik.Web.UI.Resource)((new System.Collections.ArrayList.ArrayListDebugView(((System.Web.UI.StateManagedCollection)(RadScheduler1.Resources))._collectionItems)).Items[0])).Text;

Please find the attached Screen shots.

It is slight similar to(Call Priority DROP down as per attached screen shots) DRopdown list ,so How to get selected    Resource type drop down list value by C# code...

Looking forward for your support

7 Answers, 1 is accepted

Sort by
0
DIPAK
Top achievements
Rank 1
answered on 04 Jan 2011, 11:00 AM
Looking for any support from Telerik Team .Please  provide your Input.
0
Veronica
Telerik team
answered on 05 Jan 2011, 03:57 PM
Hi DIPAK,

I also answered to your question in the Support ticket you had opened. However I'll paste the code here for those who follow this forum.

All you need is to subscribe to OnFormCreated event. Then find the RadComboBox for your resource type and get the selectedItem:

Copy Code
protected void RadScheduler1_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
    {
        if ((e.Container.Mode == SchedulerFormMode.AdvancedEdit)||(e.Container.Mode == SchedulerFormMode.AdvancedInsert))
        {
            RadComboBox roomsCombo = e.Container.FindControl("ResRoom") as RadComboBox;
            RadComboBoxItem selectedItem = roomsCombo.SelectedItem;
        }
    }

In the above code, 'Room' is the resource type name, but we need the 'res' prefix also to find the combobox control.

P.S: Please do not open more than one thread per question. We are doing our best to answer you all.

Kind regards,
Veronica Milcheva
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
Santosh
Top achievements
Rank 1
answered on 06 Nov 2013, 10:09 AM
Hi,
   Can we get same functionality for radresource type in radschedular instead of radcombobox.if i place radresource  in radschedular getting error .


0
Boyan Dimitrov
Telerik team
answered on 11 Nov 2013, 10:19 AM
Hello,

Could you please elaborate a bit more on your scenario? What exactly do you want to use instead of the default RadComboBox control? Could you please clarify whether you use the advanced from template? If yes please clarify what control you are placing in the advanced form template for the appointment resource.


Regards,
Boyan Dimitrov
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
Emad
Top achievements
Rank 1
answered on 03 Dec 2015, 06:44 PM

Hi,

 I have in group mode, I want to get resource id on form created event to assign the same to in advanced form.

I do insert manually

 

Thanks,

Emad

0
Emad
Top achievements
Rank 1
answered on 04 Dec 2015, 04:43 PM

Hi,

Please refer to below demo.
http://demos.telerik.com/aspnet-ajax/scheduler/examples/resourcegrouping/defaultcs.aspx

I want when user double click to create new appointment to ger resource id in form created event.
Please advice.
Thanks.
Emad

0
Emad
Top achievements
Rank 1
answered on 04 Dec 2015, 05:25 PM
Solved by below code
String xx = e.Appointment.Resources.GetResourceByType("USERNAME").Key.ToString();

Thanks
Tags
Scheduler
Asked by
DIPAK
Top achievements
Rank 1
Answers by
DIPAK
Top achievements
Rank 1
Veronica
Telerik team
Santosh
Top achievements
Rank 1
Boyan Dimitrov
Telerik team
Emad
Top achievements
Rank 1
Share this question
or