简体   繁体   中英

How to remove the calendar control from TrueDBGrid

Remove calender control from 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. I assign the grid DataSource to a data table

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. I suggest keeping the field as DateTime and using David Li's answer.

Use the following code to turn the EnableDateTimeEditor off in VB.Net

Grid1.Columns(index #).EnableDateTimeEditor = False

index # is the index # of Column

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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