Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am working on a desktop application. Here i want to use dataTimePicker in DataGridView to select a date in DataGridView cell. I have created a new DataGridViewColumn, DataGridViewCell and new control inherited from DateTimePicker and implementing IDataGridViewEditingControl as given in microsoft atricle of "How to: Host Controls in Windows Forms DataGridView Cells." and included the library containing above classes in my project.

But when i open datagridview columns editing page in designer i can not see the new defined column type in the ColumnType List.


Thanks in advance for any kind of help.
Posted
Updated 2-Mar-12 3:16am
v4

1 solution

Look at the MSDN help page for the System.Windows.Forms.DataGridViewCell. What is the type of its Value? Right, it's System.Object. It means: you can host nearly anything.

Please see:

http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcell.aspx[^],
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcell.value.aspx[^].

This is a short manual on hosting controls in the cells of DataGridView:
http://msdn.microsoft.com/en-us/library/7tas5c80.aspx[^].

—SA
 
Share this answer
 

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