Is it possible to manipulate the format on a DataG

2019-08-30 04:00发布

I´m using SQL Server 2005 and Visual Studio 2008, C#.

In the data source (the SQL Server data table) I use the date format mm/dd/yyyy, however, in a forms overview (DataGridView) users would like to see a completely other format, with year, week number and day number of week (yyww,d). I´ve created an algorithm for this transformation, but can I populate the affected cells with yyww,d instead of mm/dd/yyyy? And in that case - how would I do it?

I guess I need to do it after the cells are populated, but before they are shown.

The generic question is - how do I manipulate the format of Data Source bound DataGridView cells.

1条回答
相关推荐>>
2楼-- · 2019-08-30 04:14

CellFormatting Event can help it... it is triggered after populating data to cell and u can format that data as per requirement in that event

查看更多
登录 后发表回答