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

[Solved] Similar cast like columns.Template in Datakeys ?

1 Answer 11 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.
Jon Baron
Top achievements
Rank 1
Jon Baron asked on 23 Jun 2012, 02:29 AM
So I hope to be able to do something like:

columns.Bound(x => x.ID).Template(
                                        @<text>
                                                 @item.ID.ToString()
                                        </text>);

IN data keys, like:
keys.Add(@<text>
                                               @item.lId.ToString()
                                            </text>
                                            ).RouteKey("lId");

Is there something like this possible?

I need to do this because my 'lid' is a complex object, I need to somehow return its string value. I tried .ToString() and got an error that it could not be null.

Thanks!

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 27 Jun 2012, 09:57 AM
Hello Jon,

I am sorry to say that there is no such feature available. The ID should be non-complex property (string,int,guid) - not a method or complex object.

Regards,
Petur Subev
the Telerik team
Check out the successor of Telerik MVC Extensions - Kendo UI for ASP.NET MVC - and deem it for new ASP.NET MVC development.
Tags
Grid
Asked by
Jon Baron
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or