Ejemplo n.º 1
0
 private void DashboardViewer1_MasterFilterDefaultValues(object sender, MasterFilterDefaultValuesEventArgs e)
 {
     if (e.ItemComponentName == "gridDashboardItem1")
     {
         e.FilterValues = e.AvailableFilterValues.Where(v => (string)v["Sales Person"] == "Laura Callahan");
     }
     if (e.ItemComponentName == "treeViewDashboardItem1")
     {
         e.FilterValues = e.AvailableFilterValues.Where(v => (string)v["Category"] == "Beverages" ||
                                                        (string)v["Product"] == "Aniseed Syrup");
     }
 }
        private void DashboardViewer1_MasterFilterDefaultValues(object sender, MasterFilterDefaultValuesEventArgs e)
        {
            if (e.ItemComponentName == "gridDashboardItem1")
            {
                e.FilterValues = e.AvailableFilterValues.Where(v => (string)v["CategoryName"] == "Beverages" ||
                                                               (string)v["CategoryName"] == "Condiments");
            }

            if (isNeutralFilterMode)
            {
                // The SetMasterFilter method call is required in the initialization routine instead of the code below
                // if the Neutral Filter Mode is disabled.
                if (e.ItemComponentName == "cardDashboardItem1")
                {
                    e.FilterValues = e.AvailableFilterValues.Where(v => (string)v["Country"] == "UK");
                }
            }
        }