我怎样才能显示在一个DataGridView一个DateTimePicker? [英] How can I display a DateTimePicker in a DataGridView?

查看:286
本文介绍了我怎样才能显示在一个DataGridView一个DateTimePicker?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法把一个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

这篇关于我怎样才能显示在一个DataGridView一个DateTimePicker?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆