DataGridTableStyle, DataGridColumnStyle in .Net 5

MRUTYUNJAYA MAHAPATRA 1 Reputation point
2021-03-31T10:00:22.047+00:00

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

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,828 questions
Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,671 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,245 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,119 questions
Windows Network
Windows Network
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.Network: A group of devices that communicate either wirelessly or via a physical connection.
648 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Ken Tucker 5,846 Reputation points
    2021-03-31T16:40:36.857+00:00

    I would switch to using a DataGridView from the DataGrid

    0 comments No comments

  2. 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.

    0 comments No comments

  3. 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