DateTime datatype displays as date drop down by default

I have a SQL database and I am binding a grid dynamically to a number of different views/tables. All of the tables have a column called "last_update". This column is a datetime stamp. However the grid control automatically fills the column with a date picker drop down. How do I get this to just be a display of the date time coming from the database (it is not editable anyway). Code Snippet: grid.BeginUpdate(); grid.Text = sTable; dockingManager1.SetDockLabel(grid, sTable); grid.DataSource = dv; grid.Tag = nType.ToString(); grid.Model.ColWidths.ResizeToFit(GridRangeInfo.Row(0)); grid.Model.ColStyles["last_update"].CellType = "Static"; grid.Model.ColStyles["last_update"].CellValueType = typeof(DateTime); grid.Model.ColStyles["last_update"].Format = "s"; grid.Model.HideCols["id"] = true; grid.EndUpdate();

1 Reply

AD Administrator Syncfusion Team December 26, 2002 07:38 PM UTC

You can turn off this default behavior by setting this property: grid.Binder.AutoInitCellTypes = False

Loader.
Up arrow icon