We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

DateTime datatype displays as date drop down by default

Thread ID:

Created:

Updated:

Platform:

Replies:

2273 Dec 26,2002 01:58 PM Dec 26,2002 02:38 PM Windows Forms 1
loading
Tags: GridControl
Charles Carlin
Asked On December 26, 2002 01:58 PM

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();

Administrator [Syncfusion]
Replied On December 26, 2002 02:38 PM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;