Make the date in the DataGrid appear in Long date format

Source: Internet
Author: User
Tags date
datagrid| Display

Environment: win2000,vb.net 2002,.net Framework 1.0,sql Server 2000

When the date-time column in SQL SERVER 2000 is displayed by default, only the date part is displayed, and the dismount displays the long day

Period format (Yyyy-mm-dd hh:mm:ss)

Dim Mydatagridtablestyle as New DataGridTableStyle ()
Mydatagridtablestyle.mappingname =ctype (datagrid1.datasource,datatable)

Dim Adatagridtextboxcolumn as DataGridTextBoxColumn
Dim Adatagridboolcolumn as DataGridBoolColumn

' Application Date
Adatagridtextboxcolumn = New DataGridTextBoxColumn ()
Adatagridtextboxcolumn.mappingname = "Date of application"
Adatagridtextboxcolumn.headertext = "Date of application"
Adatagridtextboxcolumn.format = "Yyyy-mm-dd hh:mm:ss"
MYDATAGRIDTABLESTYLE.GRIDCOLUMNSTYLES.ADD (Adatagridtextboxcolumn)

' Other columns are also styled, as DATAGRID1 shows only the styled columns, and no styled columns are not displayed


FRMSHOPALARMINFO.DEFINSTANCE.DATAGRID1.TABLESTYLES.ADD (Mydatagridtablestyle)



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.