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.
Unfortunately, activation email could not send to your email. Please try again.

Format a TimeSpan

Thread ID:

Created:

Updated:

Platform:

Replies:

108794 May 13,2013 10:17 AM May 15,2013 11:30 PM ASP.NET Web Forms (Classic) 1
loading
Tags: GridGroupingControl
Tine Devolder
Asked On May 13, 2013 10:17 AM

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 15, 2013 11:30 PM

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.

 

[aspx.cs]

 

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.

 

Regards,

Rakesh D

 



Format Time_59194c17.zip

CONFIRMATION

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.

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.

;