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

[Solved] My DetailView is empty...

7 Answers 113 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.
Jerry
Top achievements
Rank 1
Jerry asked on 28 Sep 2011, 07:16 AM
I want a grid with three main columns and the rest of the data in the detail view.  I created  adetail view with a table displaying everything and I got nothing.  So I slimmed it down figuring to determine where I screwed up...  But even with this simple ClientTemplate I get empty detail views:
@(Html.Telerik().Grid<DisplayAssetEntryViewModel>()
    .Name("AssetGrid")
    .BindTo(@Model.AssetEntries)
    .Columns(columns =>
    {
        columns.Bound(c => c.AssetClass).Width(200);
        columns.Bound(c => c.AssetSector).Width(200);
        columns.Bound(c => c.Description);
    })
    .DetailView(detailView => detailView.ClientTemplate("<#= Shares #>"))
    .Scrollable()
)

The data in the grid is fine.  Only the detail view is empty.  How do I troubleshoot this?  Thanks.

J

7 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 28 Sep 2011, 08:32 AM
Hello Jerry,

When server binding is used as in your case, you should declare a server Template instead of ClientTemplate.

Regards,
Rosen
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
Jerry
Top achievements
Rank 1
answered on 28 Sep 2011, 07:55 PM
Perfect...  Got that working.  Is it possible to format data in a client template?
"<td class="t-last"><#= Cost #></td>"

If I wanted the Cost, in the snip above, to be formatted as a dollar amount, can that be done in the client template?
Thanks.

J
0
Accepted
Rosen
Telerik team
answered on 29 Sep 2011, 07:03 AM
Hi Jerry,

You may use telerik.formatString method to apply  formatting:

<#= $.telerik.formatString('{0:c}', Cost) #>
Regards,
Rosen
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
Jerry
Top achievements
Rank 1
answered on 29 Sep 2011, 06:25 PM
Thanks!  Where do I find documentation for this and other available function calls?  Searching the online documentation only finds references to calls like this as part of small examples, no documentation of the function call itself.

Thanks.

J
0
Rosen
Telerik team
answered on 30 Sep 2011, 07:44 AM
Hi Jerry,

I'm afraid that the method in question is not currently documented. Please excuse us for the inconvenience. 

Regards,
Rosen
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
Jerry
Top achievements
Rank 1
answered on 11 Oct 2011, 07:53 PM
Do the format string specifiers map to standard javascript specifiers? 

Thanks.
J
0
Rosen
Telerik team
answered on 12 Oct 2011, 08:46 AM
Hello Jerry,

Could you please elaborate more on what you mean by "standard javascript specifiers"? The supported formats have close resemblance to the ones used in .NET framework.

All the best,
Rosen
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
Tags
Grid
Asked by
Jerry
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Jerry
Top achievements
Rank 1
Share this question
or