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

stringformat for mergedcells

2 Answers 87 Views
GridView
This is a migrated thread and some comments may be shown as answers.
mark
Top achievements
Rank 1
mark asked on 12 Feb 2021, 03:57 PM

I have a gridview with a databound datetime column in it.

I can change its dataformatstring (or stringformat in binding) so that it shows the date in a short format (dd-mm-yyyy in dutch).

However, when those cells merge, it changes its format to include the time. This means I have a lot of cells that show something like '1-1-2021 00:00:00'.

How can I change that stringformat as well? I could only find a property called contentstringformat, which doesnt do anything.

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Vladimir Stoyanov
Telerik team
answered on 17 Feb 2021, 09:51 AM

Hello Mark,

Thank you for the provided information. 

I tested the scenario on my end, however I was not able to replicate the same result. On my end the merged cells are formatted in the same manner as the rest of the cells in the column. That is why I am attaching the sample project that I used for testing purposes. Can you check it out and see how it differs from the setup on your end?

Should you need any further assistance, can you modify the sample project in order to demonstrate the observed on your end behavior and send it back in a new support ticket (since project files cannot be attached to forum posts)? This will allow us to investigate the scenario and better assist you. 

Looking forward to your reply.

Regards,
Vladimir Stoyanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
mark
Top achievements
Rank 1
answered on 18 Feb 2021, 10:17 AM

Based on your project I figured out the difference.

I was referencing a nested property of a custom type.

I basically had DataMemberBinding="{Binding appointment.date}", which works in the cell, but not in the mergedcell.

Changing it so I had a readonly property 'date', to bind to directly fixed my issue.

I'm guessing it's because now it is recognizing it as a date property? 

Thanks a lot for the example project, that really helped!

Tags
GridView
Asked by
mark
Top achievements
Rank 1
Answers by
Vladimir Stoyanov
Telerik team
mark
Top achievements
Rank 1
Share this question
or