This is a migrated thread and some comments may be shown as answers.

Format date with day name in Headers

2 Answers 390 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ciupaz
Top achievements
Rank 2
Veteran
Ciupaz asked on 08 Jul 2020, 06:41 PM

Hello,

in the PreRender event of my RadGrid, I have columns with date field in headers.

If I have 

grdPositions.MasterTableView.GetColumn("09/07/2020")

I obtain a GridBoundColumns correctly. 

How can I format this date with day name before? (Mer 09/07/2020)

And If I dont know the exact days, but only that some headers are date field, how can format every one of them?

Thank you. 

Luis

2 Answers, 1 is accepted

Sort by
0
Accepted
Eyup
Telerik team
answered on 13 Jul 2020, 03:54 PM

Hello Luis,

 

To achieve this requirement, you can change the text of the header text explicitly in the code-behind:
https://www.telerik.com/support/kb/aspnet-ajax/grid/details/changing-radgrid-column-header-text-when-sorting-is-enabled

And to change the date to Italian format, you can use the ToString method overload which accepts the "it-IT" CultureInfo:
https://docs.microsoft.com/en-us/dotnet/api/system.datetime.tostring?view=netcore-3.1

I hope this will prove helpful.

 

Regards,
Eyup
Progress Telerik

0
Ciupaz
Top achievements
Rank 2
Veteran
answered on 13 Jul 2020, 03:57 PM

Thank you Eyup. 

L

Tags
Grid
Asked by
Ciupaz
Top achievements
Rank 2
Veteran
Answers by
Eyup
Telerik team
Ciupaz
Top achievements
Rank 2
Veteran
Share this question
or