Can we create the attached model like datagridview in C#.net Windows Form Application.

muralee raman 0 Reputation points
2024-06-19T05:42:33.01+00:00

We are planning a desktop application using c#.net. One of our challenges is to create an attached type of DataGridView.Unfortunately, we are not getting any solution for designing customized types of DataGridView.If possible above type of DataGridView in Windows form application provides a better solution. If not possible provide any other solution for that. Here is the attached DataGridView

GridSp

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,865 questions
Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
4,947 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,534 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,504 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,633 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Karen Payne MVP 35,286 Reputation points
    2024-06-19T13:19:16.72+00:00

    Best solution for strong typed data is using EF Core, BindingSource and BindingList (that allows sorting). Next would be to use Dapper, BindingSource and BindingList (that allows sorting).

    The following is done with EF Core but could had been done with Dapper.

    https://github.com/karenpayneoregon/ef-code-8-samples/tree/master/NorthWind2024StarterApp

    As it is a code sample for getting started there are things that need attention but works as is.

    Notes

    • Uses a ComboBox is the DataGridView for Countries
    • Uses a custom BindingNavigator (newer releases of .NET do not expose this)
    • Uses a customer BindingList for sorting data
    • Uses NuGet package FluentValidation for validation
    • Uses BindingList.ListChanged event to get at changes in the DataGridView
    • Avoids touching the DataGridView to get at data.

    master

    0 comments No comments