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

[Solved] link column only active after post

2 Answers 35 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.
steve
Top achievements
Rank 1
steve asked on 17 Jan 2013, 07:06 PM
When the grid loads on the page the link column shows just plain text.  It is only after doing an event that causes the post event to fire does the hyper link show.  Am I using the wrong template?  Is there a better way to display links in the grid?

@(Html.Telerik().Grid(Model)
        .Name("Grid")
        .Columns(columns =>
        {
            columns.Bound(m => m.Status)
                .Width(75)
                .IncludeInContextMenu(false);
            columns.Bound(m => m.Task)
                .ClientTemplate(Html.ActionLink("<#= Task #>", "Index", "Home", new { id = "<#= Task #>" }, null).ToHtmlString())
                .Title("Tracking #")
                .Encoded(false)
                .Width(100)
                .IncludeInContextMenu(false);
        })
 
        .DataBinding(dataBinding =>
        {
            dataBinding
                .Ajax()
                    .OperationMode(GridOperationMode.Client)
                    .Select("Details", "Home", new { ajax = ViewData["ajax"] });
            dataBinding
                .Ajax()
                    .OperationMode(GridOperationMode.Client)
                    .Select("PostDetails", "Home").Enabled((bool)ViewData["ajax"]);
        })
        .Pageable(paging => paging.Enabled(true))
        .Scrollable(scrolling => scrolling.Enabled((bool)ViewData["scrolling"]))
        .Sortable(sorting => sorting.Enabled((bool)ViewData["sorting"]))
        .Resizable(resizing => resizing.Columns(true))
        .Reorderable(reorder => reorder.Columns(true))
        .ColumnContextMenu()
        .Filterable(filtering => filtering.Enabled((bool)ViewData["filtering"]))
        .Groupable(grouping => grouping.Enabled((bool)ViewData["grouping"]))
        .Footer((bool)ViewData["showFooter"])

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 18 Jan 2013, 04:22 PM
Hi Steve,

The current Grid configuration - Grid(Model) - causes the widget to be server-bound on initial load, that's why the client template does not apply. Please refer to our online demos, which show Ajax-only data-binding.

Greetings,
Dimo
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.
0
steve
Top achievements
Rank 1
answered on 18 Jan 2013, 04:41 PM
Doh! I even seen that in one of the posts and told myself I would need to change that.  Thanks for catching that.
Tags
Grid
Asked by
steve
Top achievements
Rank 1
Answers by
Dimo
Telerik team
steve
Top achievements
Rank 1
Share this question
or