我怎样才能显示在一个DataGridView一个DateTimePicker?DataGridView、DateTimePicker

由网友(你再没有回来)分享简介:有没有办法把一个DateTimePicker控制在DataGridView?Is there any way to put a DateTimePicker control in the DataGridView?我检查了所有可能的属性,但它给复选框的选择,组合框等,但不是的DateTimePicker。I ch...

有没有办法把一个DateTimePicker控制在DataGridView?

Is there any way to put a DateTimePicker control in the DataGridView?

我检查了所有可能的属性,但它给复选框的选择,组合框等,但不是的DateTimePicker。

I checked all the possible properties but it give option of checkbox, combo box etc, but not the DateTimePicker.

推荐答案

您还没有错过任何内置的选项,但可以通过继承两个的DataGridViewColumn 的DataGridViewCell 班主办您选择的任何控制权。

You haven't missed any built-in option, but it is possible to subclass both the DataGridViewColumn and DataGridViewCell classes to host any control of your choosing.

这篇文章在MSDN上介绍的过程中更多的细节,甚至包括一些示例code: 如何在Windows主机控制窗体DataGridView细胞

This article on MSDN explains the process in more detail, and even includes some sample code: How to: Host Controls in Windows Forms DataGridView Cells

您还可以找到code项目的完整示例:通用的DataGridView V2.0

You can also find a complete sample on Code Project: Generic DataGridView V2.0

阅读全文

相关推荐

最新文章