如何使用datetimepicker控件绑定DataGridView的现有列 [英] How to bind a existing column of DataGridView with datetimepicker control

查看:116
本文介绍了如何使用datetimepicker控件绑定DataGridView的现有列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我浏览了许多文章,但是每个人都重定向到如何:Windows窗体DataGridView单元中的主机控件

但是问题出在这里是我不想在文章说的做到这一点上添加新列到我的DataGridView中,我有一个通过Grid的DataSource属性填充的DataGridView,数据来自数据库并填充了间接填充DataGridView的数据集.

所以想问问如何使用上面的文章将datetimepicker添加到我现有的datagrid列中.到目前为止,我已经创建了三个类,即CalendarColumn.cs,CalendarCells.cs和CalendarEditingControl.cs.

还想问一下该列具有的NULL值.Null值将由类处理还是我们必须添加一些代码?

任何链接或文章,将不胜感激.在此先感谢您.

I have gone through many articles but everyone redirects to How to: Host Controls in Windows Forms DataGridView Cells

But the problem lies here is that I dont want to add new column to my DataGridView which the article says to do it.I am having a DataGridView which is filled through the DataSource property of Grid.The data is coming from the database and filling the Dataset which indirectly fills the DataGridView.

So would like to ask how to add datetimepicker to my existing column of datagrid using the above article.So far I have created three classes namely CalendarColumn.cs, CalendarCells.cs and CalendarEditingControl.cs.

Also would like to ask about the NULL values the column has.Will the Null values will be handled by the classes or do we have to add some code?

Any links or articles would be appreciated. Thanks in advance.

推荐答案

在此处查看我的文章和演示代码

DataGridViewExtension [
Check out my article and demo code here

DataGridViewExtension[^]

I have already implemented a DateTimePicker column


这篇关于如何使用datetimepicker控件绑定DataGridView的现有列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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