I would switch to using a DataGridView from the DataGrid
DataGridTableStyle, DataGridColumnStyle in .Net 5
Hi, We are migrating our project to .Net 5
DataGridTableStyle, DataGridColumnStyle is deprecated in >Net 5 .Can anybody please tell me that what is the corresponding of that .Net 5
3 answers
Sort by: Most helpful
-
-
Daniel Zhang-MSFT 9,611 Reputation points
2021-04-01T01:49:43.173+00:00 Hi MRUTYUNJAYAMAHAPATRA-6389,
As document said that starting with .NET Core 3.1, various Windows Forms controls are no longer available, such as DataGrid.
And associated APIs (DataGridTableStyle, DataGridColumnStyle, DataGridLineStyle...)that are removed.
The recommended replacement is DataGridView, you can see all the properties and methods it currently supports in this document.
Best Regards,
Daniel Zhang
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
-
Karen Payne MVP 35,036 Reputation points
2021-04-01T12:19:18.897+00:00 Hello,
Best to use a DataGridView, format cells using CellFormating event. Although a DataGrid has been around for a long time, since the DataGridView arrived this is the recommended way to work with data. Upside, you have more control over styling, downside, styling requires more effort on the part of a developer.
The following Microsoft Word document should be more than enough to help with formatting and more.
Resources for formatting