简体   繁体   中英

Datagridview vertical alignment in datetime input column

I have an application for windows made in visual basic. In a Windows Form there is a Datagridview with several columns. In all of them the vertical alignment is Middlecenter. The data is displayed correctly in the Text type columns, but in a column that is of the Datetime type the data is displayed in the lower part of the cells. Is it possible to see this data in the middle part of the cells?

In your form_load try:

  DGV1.Columns(3).DefaultCellStyle.Alignment.MiddleCenter

Assuming your datagridview is called DGV1 and the column with your Date-Time is column 3.

BR Fnk

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM