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

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.
7,026 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: The period of time during which a program is being executed in a computer.
960 questions
Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,331 questions
No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Karen Payne MVP 29,236 Reputation points MVP
    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.

    No comments