Welcome to WindowsClient.net | Sign in | Join

Here are some frequently asked questions about Windows Forms and their answers.

Windows Forms FAQs

How do I add a control to a DataGridView column header?

How do I add a control to a column header like a Button or TextBox?

We don't have any built in support for this since column header cells do not have code to allow it to be editable. For a button you can simply custom paint the button by handling the Cell.Paint method. A text box though you'll need to either not show the standard column header cells and custom paint your own. If you do this, make sure you set the first row Frozen property to true so the headers don't scroll off the screen. An alternative, but maybe harder way is to manually position a text box in the column header location when the user performs some action that "starts" editing the column header cell.