We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Import MS Access database to a SFDataGrid

Thread ID:





119167 May 17,2015 12:15 AM UTC May 19,2015 03:22 PM UTC WPF 2
Tags: SfDataGrid
Asked On May 17, 2015 12:15 AM UTC


I'm trying to import a MS Access database to a SFDataGrid, since I'd like to use the filter and sorting for this control. I got it working for a WPF DataGrid using the tutorial here and then build the project, go to the Data Sources toolbar, make sure DataGrid is selected from the dropdown for the dataset and then drag and drop into the design view. I was unable to figure out how to add the SFDataGrid control as a custom control for this dataset (under Customized Control Binding). I have the code below after messing around with the DataGrid code, but it doesn't display any data -- only the headers.

What is the best way to import a MS Access database into a SFDataGrid?

        xmlns:local="clr-namespace:AccessWPFTest" x:Class="AccessWPFTest.MainWindow"
        d:DesignHeight="1280" d:DesignWidth="1080"
        Loaded="Window_Loaded" >

            <local:TestDatabaseDataSet x:Key="testDatabaseDataSet"/>
            <CollectionViewSource x:Key="test_1ViewSource" Source="{Binding Test_1, Source={StaticResource testDatabaseDataSet}}"/>

    <Grid DataContext="{StaticResource test_1ViewSource}">

        <syncfusion:SfDataGrid x:Name="test_1DataGrid" ColumnSizer="Auto" ItemsSource="{Binding test_1ViewSource}" >
                <syncfusion:GridTextColumn x:Name="number" HeaderText="Number" Binding.XmlNamespaceManager="{Binding Number}"/>
                <syncfusion:GridTextColumn x:Name="number2" HeaderText="Number2" Binding.XmlNamespaceManager="{Binding Number2}"/>



private void Window_Loaded(object sender, RoutedEventArgs e)
            AccessWPFTest.TowerDatabaseDataSet towerDatabaseDataSet = ((AccessWPFTest.TowerDatabaseDataSet)(this.FindResource("towerDatabaseDataSet")));
            // Load data into the table TW230kV_1. You can modify this code as needed.
            AccessWPFTest.TowerDatabaseDataSetTableAdapters.TW230kV_1TableAdapter towerDatabaseDataSetTW230kV_1TableAdapter = new AccessWPFTest.TowerDatabaseDataSetTableAdapters.TW230kV_1TableAdapter();
            System.Windows.Data.CollectionViewSource tW230kV_1ViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("tW230kV_1ViewSource")));

Replied On May 17, 2015 12:32 AM UTC

The Window_Loaded function was not edited properly; so that someone could replicate my problem in the future, could someone delete/replace that part from the OP with the following? Many thanks in advance.

private void Window_Loaded(object sender, RoutedEventArgs e)
            AccessWPFTest.TestDatabaseDataSet testDatabaseDataSet = ((AccessWPFTest.TestDatabaseDataSet)(this.FindResource("testDatabaseDataSet")));
            // Load data into the table Test_1. You can modify this code as needed.
            AccessWPFTest.TestDatabaseDataSetTableAdapters.Test_1TableAdapter towerDatabaseDataSetTest_1TableAdapter = new AccessWPFTest.TestDatabaseDataSetTableAdapters.Test_1TableAdapter();
            System.Windows.Data.CollectionViewSource test_1ViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("test_1ViewSource")));

Jai Ganesh S [Syncfusion]
Replied On May 19, 2015 03:22 PM UTC

Hi Cindy,

Thank you for using Syncfusion products.

We have analyzed your query. Asupport incident has been created under your account to track the status of this query. Please log on to our support website to check for further updates


Please let us know if you have any queries.

Thank you,

Jai Ganesh S


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon