Objective Grid: The current DateTime control only displays the Date

Article ID: 764
Last updated: 03 Apr, 2018
Article ID: 764
Last updated: 03 Apr, 2018
Revision: 3
Views: 1726
Posted: 22 Aug, 2005
by Meltreger B.
Updated: 03 Apr, 2018
by Crook T.

Problem


The current DateTime control only displays the Date.


Cause



Action


The format of the DateTime control is set by the User Attribute

as shown in the following Grid Control code snippet:

 

private void gridControl1_GridInitialized(object sender, System.EventArgs e)

{

            Style s = new Style();

            s.Control = Stingray.Grid.ControlType.DateTime;

            s.set_UserAttribute(Stingray.Grid

                                                            .UserAttributeID.CUSTOMFORMAT, "hh:mm");

            s.Value = DateTime.Today.ToString();

            gridControl1[1,1].Style = s;

}

*NOTE: See the GridApp sample provided with the MFC Objective Grid product for more details about the User Attribute.

This article was:   Helpful | Not helpful
Report an issue
Article ID: 764
Last updated: 03 Apr, 2018
Revision: 3
Views: 1726
Posted: 22 Aug, 2005 by Meltreger B.
Updated: 03 Apr, 2018 by Crook T.

Others in this category