0

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!

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
David Li
  • 1
  • 1

2 Answers2

0

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.

nhbiker834
  • 136
  • 1
  • 3
0

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

Grid1.Columns(index #).EnableDateTimeEditor = False

index # is the index # of Column

David Li
  • 1
  • 1
  • You could also cast the field as a VARCHAR() in the query, so that the DataTable in the DataSet has a type of String instead of Date. – HardCode Mar 23 '12 at 20:30