Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Scheduler and Reminder > Filter Resources by Visibility

Not answered Filter Resources by Visibility

Feed from this thread
  • Daniel avatar

    Posted on Mar 23, 2011 (permalink)

    Hi

    I want to use the grouping function of radScheduler to only group visible resources.
    But it does not work, it always shows all resources.
    What am I doing wrong?

    *** sample code loading Resources

                Resource tempResource = null;

                recResourceGroup[] resourceGroups = plannerSettings.recResourceGroup;
                foreach (recResourceGroup resourceGroup in resourceGroups)
                {
                    tempResource = new Resource("G-"+resourceGroup.No,resourceGroup.Name);
                    tempResource.Visible = false;
                    tempResource.Color = Color.Orange;
                    plannerSchedule.Resources.Add(tempResource);

                    recResource[] resources = resourceGroup.recResource;
                    foreach (recResource resource in resources)
                    {
                        string sKey = resource.IsRentalItem.ToString() == "1" ? "M" : "R";
                        sKey += resource.VirtualResource.ToString() == "1" ? "V-" : "-";
                        tempResource = new Resource(sKey+resource.No,resource.Name);
                        tempResource.Visible = false;
                        tempResource.Color = Color.Green;
                        plannerSchedule.Resources.Add(tempResource);
                    }
                }

    *** sample code loading Appointment-Resources

    foreach (recResourceAssigned planningAssignedResource in planningAssignedResources)
    {
        string sKey = null;
        switch (planningAssignedResource.Type.ToString())
        {
            case "0":  //resource
                {
                    sKey = "R-" + planningAssignedResource.No.ToString();
                }
                break;
            case "1":  //resourceGroup
                {
                    sKey = "G-" + planningAssignedResource.No.ToString();
                }
                break;
            case "2":  //workPlace
                {
                    sKey = "W-" + planningAssignedResource.No.ToString();
                }
                break;
            default:
                {
                    //error not supported
                }
                break;
        };
        schedulerApp.ResourceIds.Add(plannerSchedule.Resources.GetById(sKey).Id);
    }

    *** Sample code switching visibility of Resources

      foreach (Resource resource in radScheduler1.Resources)
      {
          string tempKey = resource.Id.KeyValue.ToString();
          switch(groupby)
          {
              case "resource":
                  resource.Visible = tempKey.Contains("R-") ? true : false;
                  break;
              case "resourceGroup":
                  resource.Visible = tempKey.Contains("G-") ? true : false;
                  break;
              case "workplace":
                  resource.Visible = tempKey.Contains("W-") ?  true : false;
                  break;
              case "order":
                  resource.Visible = tempKey.Contains("J-") ? true : false;
                  break;
             default:
                  resource.Visible = false;
                  break;
           }
    ...
      

     

     

    radScheduler1.RepaintElements();

     

     

     


    any ideas?
    Daniel

    Reply

  • Dobry Zranchev Dobry Zranchev admin's avatar

    Posted on Mar 28, 2011 (permalink)

    Hello Daniel,

    Thank you for writing.

    RadScheduler does not filter the resources by their visibility. If you want to hide some of the resources, you should to remove them from the Resources collection of RadScheduler. When you want to use them again, you should just add them to the same collection.

    In case that you have other related questions, do not hesitate to write back.

    Regards,
    Dobry Zranchev
    the Telerik team

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Scheduler and Reminder > Filter Resources by Visibility
Related resources for "Filter Resources by Visibility"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]