samples/windowsforms/datagridview
..
CSWinFormDataGridView
images
README.md

README.md

DataGridView Samples

This Windows Forms sample was ported to .NET Core from a previous .NET Framework 4.5 sample.

This sample demonstrates DataGridView usage in a .NET Core 3 Windows Forms app. It contains five separate sample DataGridView scenarios. Uncomment the one you wish to run in Program.cs:

  • CustomDataGridViewColumn
  • DataGridViewPaging
  • EditingControlHosting
  • JustInTimeDataLoading
  • MultipleLayeredColumnHeader

Note that the DataGridViewPaging and JustInTimeDataLoading samples use the NorthWind sample database (in order to have a large amount of data to display in the grid view). Before running these scenarios, follow the these instructions to set up the NorthView sample database and make sure that the connection strings in those scenarios are updated to match where the sample database is deployed (possibly replacing localhost with (LocalDb)\MSSQLLocalDB, for example).

Screenshot with paging

Screenshot with layered column header