-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form1.cs
34 lines (30 loc) · 1.23 KB
/
Form1.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using DevExpress.XtraCharts;
using DevExpress.XtraEditors;
using System;
using System.Collections.Generic;
using System.Linq;
namespace FilterCriteriaSample {
public partial class Form1 : XtraForm {
public Form1() {
InitializeComponent();
using(NwindDbContext context = new NwindDbContext()) {
Products = context.Products.ToList();
FilterViewModel = new FilterViewModel(context);
}
}
#region #FilterCriteria
Series ProductSeries { get { return chartControl.Series["Products"]; } }
List<Product> Products { get; set; }
FilterViewModel FilterViewModel { get; set; }
private void Form1_Load(object sender, EventArgs e) {
ProductSeries.DataSource = Products;
ProductSeries.ArgumentDataMember = "ProductName";
ProductSeries.ValueDataMembers.AddRange("OnOrderIncome");
filteringUIContext.ParentViewModel = FilterViewModel;
filteringUIContext.ModelType = typeof(Product);
filteringUIContext.SetFilterCriteriaBinding(ProductSeries, s => s.FilterCriteria);
filteringUIContext.RetrieveFields();
}
#endregion #FilterCriteria
}
}