This example shows how to connect to the NorthWind database and display data from the Customers table.
using System.Windows;
namespace DXGrid_BindingToMSAccessDb {
public partial class Window1 : Window {
public Window1() {
InitializeComponent();
grid.ItemsSource =
new nwindCustomerDataSetTableAdapters.CustomersTableAdapter().GetData();
}
}
}
<Window x:Class="DXGrid_BindingToMSAccessDb.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
Title="Window1" Height="291" Width="518">
<Grid>
<dxg:GridControl x:Name="grid" AutoGenerateColumns="AddNew">
<dxg:GridControl.View>
<dxg:TableView />
</dxg:GridControl.View>
</dxg:GridControl>
</Grid>
</Window>
<Application
x:Class="DXGrid_BindingToMSAccessDb.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="Window1.xaml">
<Application.Resources>
</Application.Resources>
</Application>
Imports System.Windows
Namespace DXGrid_BindingToMSAccessDb
''' <summary>
''' Interaction logic for App.xaml
''' </summary>
Partial Public Class App
Inherits Application
End Class
End Namespace
Imports System.Windows
Namespace DXGrid_BindingToMSAccessDb
Partial Public Class Window1
Inherits Window
Public Sub New()
InitializeComponent()
grid.ItemsSource = (New nwindCustomerDataSetTableAdapters.CustomersTableAdapter()).GetData()
End Sub
End Class
End Namespace