Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > DataGridView With UserControl
 

DataGridView With UserControl

Hi All

I have create a UserControl and I want to add this control to my datagridview how to do that

thanks

sian  Wednesday, January 23, 2008 11:19 AM

You can use a row template or a cell template.

Sheng Jiang 蒋晟  Wednesday, January 23, 2008 8:38 PM

Hi, if you want to host control in datagridview, you can check this article

How to: Host Controls in Windows Forms DataGridView Cells

There isan example 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.

Best Regards

Gavin

Gavin Jin - MSFT  Friday, January 25, 2008 2:31 AM

You can use a row template or a cell template.

Sheng Jiang 蒋晟  Wednesday, January 23, 2008 8:38 PM

Hi, if you want to host control in datagridview, you can check this article

How to: Host Controls in Windows Forms DataGridView Cells

There isan example 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.

Best Regards

Gavin

Gavin Jin - MSFT  Friday, January 25, 2008 2:31 AM

You can use google to search for other answers

Custom Search

More Threads

• how to hit enter key to move to next control?
• DataGridView with RichTextBox Column
• DataGridViewCell
• what is an resx file what is the use of it how to use it
• DataGridViewButtonCell - change back color of button in the cell
• About access
• New Row in bound grid: default value not set in data source
• Datagridview row selection
• Drag-Drop on Panel...
• How to use CheckBox in DataGridView with data bound?