本文介绍了datagridview datetimepicker列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到一种情况,我只需要在我的Datagrid列中显示特定日期的月份,同时保持基础值

I have a situation where I need to only display the month of a specific date in my Datagrid Column while keeping the underlying value

推荐答案

DataGridView1.Columns(ColumnIndex).DefaultCellStyle.Format = "MMM"


或者,可以在设计器中通过右键单击DataGridView 选择EditColumns 菜单选项进行设置.然后在列列表中选择相关列,并在propertygrid中设置"MMM" DefaultCellStyle .


Alternatively, this can be set in the designer by right clicking on the DataGridView selecting the EditColumns menu option. Then selecting the Column concerned in the list of columns and setting the "MMM" DefaultCellStyle in the propertygrid.


这篇关于datagridview datetimepicker列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 03:15