How to display a usercontrol in DataGridView C#

Mike 1 Reputation point
2021-10-23T11:56:31.83+00:00

Hello,

in my program i have a DataGridView and i want to have a column with multiple custom buttons (e.g. edit button, delete button, copy button).
E.g.
143161-grafik.png

How can i do this?

Thanks in advance

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,811 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,098 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,109 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Karen Payne MVP 35,016 Reputation points
    2021-10-23T21:54:56.58+00:00

    To do this requires a bit of an effort to draw each image in cell paint event while without an image like the one I did below is a good deal easier.

    In the screenshot below the button only appear on the current row and adding additional columns is easy. Base code is here in the following repository.

    143133-dgvbuttons.png

    If you really want a clean/polish look than check out telerik grid here.

    0 comments No comments