Click here to Skip to main content
15,171,439 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
multiple controls in one datagridview cell. I want Add two controls in one datagridview cell my windows application please don,t draw the controls . It is possible to do.Pls give me a solution.pls Don't draw the controls.............

Thanking You......

Updated 22-May-12 23:48pm
sjelen 16-May-12 6:48am
WinForms or WPF application?
vignesh9894620769 16-May-12 6:58am
C# windows form

1 solution

Windows Forms controls can be hosted in a DataGridViewCell. An example is given here
How to: Host Controls in Windows Forms DataGridView Cells[^] which shows how to create a calendar column.
The cells of this column display dates in ordinary text box cells, but when the user edits a cell, a DateTimePicker control appears. In order to avoid having to implement text box display functionality again, the CalendarCell class derives from the DataGridViewTextBoxCell class rather than inheriting the DataGridViewCell class directly. as explained at the above reference.

I think it may be helpful.
Maciej Los 16-May-12 11:21am
Good answer and link, my 5!
I think, OP want an example: how to add 2 controls in one cell of DataGridView.
VJ Reddy 16-May-12 11:32am
Thank you, losmac :)
You may be right.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900