-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainForm.vb
29 lines (24 loc) · 1.14 KB
/
MainForm.vb
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
Imports System
Imports System.Data
Imports System.Linq
Imports DevExpress.Data
Imports DevExpress.XtraEditors
Imports DxSample.Filtering
Namespace DxSample
Public Partial Class MainForm
Inherits XtraForm
Public Sub New()
InitializeComponent()
End Sub
Private Sub MainForm_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim ds As DataSet = New DataSet()
ds.ReadXml("nwind.xml")
Dim dt As DataTable = ds.Tables("Customers")
Dim customers = From r In dt.Rows.Cast(Of DataRow)() Let required = New String() {"ANTON", "BERGS", "BLONP", "BOLID", "COMMI", "FOLKO", "GALED", "GODOS", "HILAA"} Where required.Contains(CStr(r("CustomerID"))) Select New With {.CompanyName = CStr(r("CompanyName")), .ContactName = CStr(r("ContactName")), .ContactTitle = CStr(r("ContactTitle"))}
GridControl.DataSource = customers.ToList()
End Sub
Private Sub GridView_SubstituteFilter(ByVal sender As Object, ByVal e As SubstituteFilterEventArgs)
e.Filter = GridFilterSubstitutor.Substitute(e.Filter)
End Sub
End Class
End Namespace