简体   繁体   English

如何从 TrueDBGrid 中删除日历控件

[英]How to remove the calendar control from TrueDBGrid

Remove calender control from TrueDBGrid Cell David [ON, Canada] 26-Feb-2012 09:39:51从 TrueDBGrid Cell 中删除日历控件 David [ON, Canada] 26-Feb-2012 09:39:51

When using C1.Win.C1TrueDBGrid.2 (Version 2.0.20111.61210) in Visual studio 2010 on windows7.在 windows7 上的 Visual Studio 2010 中使用 C1.Win.C1TrueDBGrid.2(版本 2.0.20111.61210)时。 I assign the grid DataSource to a data table我将网格数据源分配给数据表

VB.Net VB.Net

Grid1.DataSource = MyDataset
Grid1.DataMember = "table1" 'table1 is one of Mydataset tables
Grid1.Rebind()
Grid1.Refresh()

one of the fields in the table are date value, then in the cell a calendar control is there, I only can click the calendar to choose a day, but I want to remove the calendar control in the cell, how to do it?表中的一个字段是日期值,那么单元格中有一个日历控件,我只能点击日历选择一天,但是我想删除单元格中的日历控件,怎么做? Thanks to any help!感谢任何帮助!

If you are sorting your column, don't use HardCode's solution, as sorting a string date will not work properly.如果您正在对列进行排序,请不要使用 HardCode 的解决方案,因为对字符串日期进行排序将无法正常工作。 I suggest keeping the field as DateTime and using David Li's answer.我建议将该字段保留为 DateTime 并使用 David Li 的回答。

Use the following code to turn the EnableDateTimeEditor off in VB.Net使用以下代码在 VB.Net 中关闭 EnableDateTimeEditor

Grid1.Columns(index #).EnableDateTimeEditor = False Grid1.Columns(index #).EnableDateTimeEditor = False

index # is the index # of Column index # 是列的索引 #

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM