How to remove extra item(-) in rad new Scheduler appointment window

5 posts, 0 answers
  1. Venkata
    Venkata avatar
    128 posts
    Member since:
    Nov 2009

    Posted 29 May 2012 Link to this post

    Hi,
    I am using RadScheduler to create an new appointment(i am using latest version of Telerik.Web.UI.dll  version 2012.1.501.40).
    When  i bind  the ResourceType from C# code behind             
    ResourceType rt = new ResourceType("UserCalender");          
    rt.ForeignKeyField = "UserTypeId";
    rt.KeyField = "UserTypeId";
    rt.TextField = "UserTypeName";         
    rt.DataSource = GetUserTypes();
    RadScheduler1.ResourceTypes.Add(rt);

     i am getting 1 extra option "-" in my comboBox
    Like
       "-"
       "Development"
       "Testing"

    I do not want that Extra  "-" in my combobox. So How to i remove that one and how do i select default option in combobox?
  2. Venkata
    Venkata avatar
    128 posts
    Member since:
    Nov 2009

    Posted 30 May 2012 Link to this post

    Any Help?
  3. Plamen
    Admin
    Plamen avatar
    2965 posts

    Posted 31 May 2012 Link to this post

    Hi Venkata,

     
    You can refer to the Handling FormCreated help topic where Change the selected index of a resource combobox so always one option is preselected section similar scenario is explained.

    Hope this will be helpful.

    Greetings,
    Plamen Zdravkov
    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.
  4. Venkata
    Venkata avatar
    128 posts
    Member since:
    Nov 2009

    Posted 31 May 2012 Link to this post

    Thanks for the reply.
    I can able to select one of the item.
    But Still shows "-" item in my resource combobox 
    How do i remove that item?
  5. Venkata
    Venkata avatar
    128 posts
    Member since:
    Nov 2009

    Posted 31 May 2012 Link to this post

    protected void RadScheduler1_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
    {
        if ((e.Container.Mode == SchedulerFormMode.AdvancedEdit) || (e.Container.Mode == SchedulerFormMode.AdvancedInsert))
        {
            RadComboBox resourceRoomCombo = e.Container.FindControl("ResRoom") as RadComboBox;
            foreach (RadComboBoxItem rcbi in resourceRoomCombo.Items)
         {
           if (rcbi.Text == "-")
           {
           resourceRoomCombo.Items.Remove(0);
           break;
           }
          
        }
    }
Back to Top