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

8 posts, 0 answers
  1. DIPAK
    DIPAK avatar
    2 posts
    Member since:
    Nov 2010

    Posted 03 Jan 2011 Link to this post

    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

  2. DIPAK
    DIPAK avatar
    2 posts
    Member since:
    Nov 2010

    Posted 04 Jan 2011 Link to this post

    Looking for any support from Telerik Team .Please  provide your Input.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 05 Jan 2011 Link to this post

    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.
  5. Santosh
    Santosh avatar
    24 posts
    Member since:
    Sep 2013

    Posted 06 Nov 2013 Link to this post

    Hi,
       Can we get same functionality for radresource type in radschedular instead of radcombobox.if i place radresource  in radschedular getting error .


  6. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 11 Nov 2013 Link to this post

    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.
  7. Emad
    Emad avatar
    16 posts
    Member since:
    Dec 2015

    Posted 03 Dec 2015 Link to this post

    Hi,

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

    I do insert manually

     

    Thanks,

    Emad

  8. Emad
    Emad avatar
    16 posts
    Member since:
    Dec 2015

    Posted 04 Dec 2015 in reply to Emad Link to this post

    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

  9. Emad
    Emad avatar
    16 posts
    Member since:
    Dec 2015

    Posted 04 Dec 2015 in reply to Emad Link to this post

    Solved by below code
    String xx = e.Appointment.Resources.GetResourceByType("USERNAME").Key.ToString();

    Thanks
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017