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

Format a Action Link

3 Answers 96 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Bob
Top achievements
Rank 1
Bob asked on 08 May 2012, 10:07 PM
We can't seem to figure out how to format a date that we want to be a link. We are able to make the link in the cell, but we can't seem to format the date the way we want it to show.

We are using Ajax binding btw.

BOb

3 Answers, 1 is accepted

Sort by
0
Accepted
Petur Subev
Telerik team
answered on 09 May 2012, 07:13 AM
Hello Bob,

Generally speaking you can use the $.telerik.formatString utility method to format your date.
e.g.
ClientTemplate("The date is :<#= $.telerik.formatString('{0:dd/MM/yyyy}', yourDateProperty ) #>")
I hope this helps.

Regards,
Petur Subev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
0
Bob
Top achievements
Rank 1
answered on 09 May 2012, 03:25 PM
Thanks... that works great.

BOb
0
Mike
Top achievements
Rank 1
answered on 06 Jul 2012, 07:11 PM
This isn't working for me:

columns.Bound(model => model.DateAdmitted)
			.Template(o => o.DateAdmitted.ToString("d"))
			.ClientTemplate(
				 "<#= $.telerik.formatString('{0:dd/MM/yyyy}', DateAdmitted ) #>"
				);	

I get values looking like:

/Date(-62135578800000)/

Also when I substitute just <#= DateAdmitted #> I get the same results.

Please advise on what I am doing wrong.
Tags
Grid
Asked by
Bob
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Bob
Top achievements
Rank 1
Mike
Top achievements
Rank 1
Share this question
or