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

Developer technologies | Windows Forms
Developer technologies | .NET | .NET Runtime
Developer technologies | C#
Developer technologies | 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.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Karen Payne MVP 35,591 Reputation points Volunteer Moderator
    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

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.