Skip to content

Datagridview controls or user controls as cells #383

Description

@itg-assistant

Gunter asked 2016-11-14 13:00:39 UTC

Hi

how can i get a control or a usercontrol  as a cell. I tried something like that, but it didn't work

Snippet

PictureBox pictureBox = new PictureBox();
pictureBox.Image = global::TestWiseJ.Properties.Resources.A1;

row.Cells[2].Control = pictureBox;
row.Cells[2].Style.Alignment = DataGridViewContentAlignment.MiddleCenter;

MyUserControl u = new MyUserControl();
row.Cells[2].Control = u;
row.Cells[2].Style.Alignment = DataGridViewContentAlignment.MiddleCenter;

Metadata

Metadata

Assignees

No one assigned

    Labels

    GeneralQuestions, how-tos and everything else.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions