Back to Devexpress

Lesson 1 - Add a GridControl to a Project and Bind it to Data

wpf-9644-controls-and-libraries-data-grid-getting-started-designer-lesson-1-add-a-gridcontrol-to-a-project.md

latest2.6 KB
Original Source

Lesson 1 - Add a GridControl to a Project and Bind it to Data

  • Feb 09, 2024
  • 4 minutes to read

This tutorial demonstrates how to add a GridControl to your project and bind the control to a database:

Tip

The following tutorials demonstrate how to bind the GridControl to different data sources:

  1. Use the DevExpress Template Gallery to create a new Blank MVVM Application. This project template contains a boilerplate View Model class and sets it as a data context for the MainView :

  2. Connect the project to a local database as demonstrated in the following example: Blank .NET 6 App with the Northwind Database.

  3. Add the GridControl toolbox item to the MainView :

  4. Select the GridControl and invoke its Quick Actions menu. Click Bind to a Data Source to launch the Items Source Wizard:

  5. Select a data source:

  6. The Items Source Wizard generates the following code:

  7. Run the project:

See Also

Lesson 2 - Configure Columns and Editors

Lesson 3 - Post Changes to a Database

Lesson 4 - Sort, Group, Filter Data

Lesson 5 - Display Summaries

WPF Data Grid: Bind to Data

Design-Time Features