Welcome to FoxLearn
In this video, I'll show you how to use GridControl in DevExpress using C#
After you finish creating a new Windows Forms project, you need to create a DevExpress Form
Next, Open your form designer, then drag the GridControl from your visual studio toolbox into your form designer
The GridControl provides rich capabilities for displaying, shaping and editing data from any data source.
Next, Right click on your project, then add an ADO.NET Entity Data Model to your project
We will use Entity Framework to retrieve data from the Northwind database
Entity Framework is an open-source ORM framework for .NET applications supported by Microsoft
It enables developers to work with data using objects of domain specific classes without focusing on the underlying database tables and columns where this data is stored
In this video, I'll use the product and category tables in the Northwind database to get the data,
then display the data into the GridControl
After you finish creating the ADO.NET Entity Data Model,
you should see the diagram as shown in my video
And don't forget to rebuild your project.
Next, You need to click on the arrow icon on GridControl,
then add the DataSource to your GridControl
Next, double-click on your form to add a Form_Load event handler that allows you to initialize the data source into GridControl
Next, Click the Run Designer button on GridControl to attach a RepositoryItemGridLookUpEdit to GridControl that allows you to display the category name
And don't forget to set DataSource,
display member, and value member to RepositoryItemGridLookUpEdit
Next, Select the column section, then set the ColumnEdit property of the Category column to RepositoryItemGridLookUpEdit
You can easily filter products by category or filter data in any column
You can also remove any columns or group data by columns
If you want to change the look and feel of your form, you can use the DevExpress Project Settings
Thank you for watching this video and don't forget to subscribe to my channel