We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Format a TimeSpan

Thread ID:





108794 May 13,2013 02:17 PM UTC May 16,2013 03:30 AM UTC ASP.NET Web Forms (Classic) 1
Tags: GridGroupingControl
Tine Devolder
Asked On May 13, 2013 02:17 PM UTC

I have ==> hh:mm:ss 
I want ==> hh:mm

I try this ==>
if (e.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell || e.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell)
                if (e.TableCellIdentity.Column.Name == "Time")
                    e.Style.Format = "hh:mm";

Rakesh D [Syncfusion]
Replied On May 16, 2013 03:30 AM UTC

Hi Tine,


Thank you for using Syncfusion products.


Query : Format a Time Span ?


Based on the information provided we suspect that you are having “hh:mm:ss” in string format and want to apply formatting “hh:mm” to it. We suggest you to set the CellType of that Column to “MonthCalendar”. Please refer below code snippet for further details.




this.GridGroupingControl1.TableDescriptor.Columns[2].Appearance.AnyRecordFieldCell.CellType = "MonthCalendar";



For your convenience we have prepared a sample for the above scenario and it is attached below. Please refer to it.



Please let us know if you have any concerns.



Rakesh D


Format Time_59194c17.zip


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon