Hello,
I use a filter with a dropdownlist to filter ressource of my scheduler. But when I filter it, the parent ressource without children still apear on the scheduler.
Is there a way to hide those parents after i populate all the ressources ?
This is how i load my ressource:
private void LoadResources()
{
DataTable locations = new DataManager().GetLocations();
DayPilotScheduler1.Resources.Clear();
foreach (DataRow location in locations.Rows)
{
int id = Convert.ToInt32(location["CAT_ID"]);
Resource r = new Resource((string)location["CAT_Name"], null); // using null for resources that can't be used
r.IsParent = true; // marking as parent for the case that no children are loaded
r.Expanded = true;
r.Value = id.ToString();
int Bu = Int32.Parse(BuFilter.SelectedValue.ToString());
DataTable consultants;
if (Bu == -1)
{
consultants = new DataManager().GetLocations(id);
}
else
{
consultants = new DataManager().GetLocations(id, Bu);
}
foreach (DataRow dr in consultants.Rows)
{
string fullName = (string)dr["RES_Name"] + " " + dr["RES_FirstName"].ToString();
Resource c = new Resource(fullName, Convert.ToString(dr["RES_ID"]));
c.Value = Convert.ToString(dr["RES_ID"]);
r.Children.Add(c);
}
DayPilotScheduler1.Resources.Add(r);
}
}
Thanks