Question

I have MVC project. In this project i used Telerik window as popup and for content of the window i used Telerik MVC grid. When i run the program i see popup and grid inside it but when i clicked in a sort or filter.

It opens another page and show the grid on it. My problem is how can i render grid for sorting and filtering in a popup page that's partial view?

Sample images

This is code of my window popup:

        div class="t-rtl">
            @{  Html.Telerik().Window()
                .Name("PersonelList")
                .Title("جستجوی کاربران")
                .Content(@<text>@Html.Action("PersonelGridPopup", "Shared")</text>)
                .Width(500)
                .Height(300)
                .Scrollable(true)
                .Draggable(true)
                .Visible(false)
                .Render();        
            }
        </div>
    and this is code of my partialview for grid
    @(Html.Telerik().Grid(Model)
            .Name("PersonelGrid")
            .Columns(columns =>
            {
                columns.Bound(o => o.PersonnelNumber).Width(150).Title("کد پرسنلی").Template(@<text><div><a class="popup" onclick="SendValue(this.innerHTML)">@item.PersonnelNumber</a></div></text>);
                columns.Bound(o => o.Name).Width(100).Title("نام");
                columns.Bound(o => o.Family).Title("نام خانوادگی");
                columns.Bound(o => o.OrgPosition1.Title).Title("سمت سازمانی");
            })
            .Sortable()
            .Filterable()
            .Localizable("fa-IR")
            .Footer(false)
    )
    @{ Html.Telerik().ScriptRegistrar().Globalization(true); }
Was it helpful?

Solution

Your grid has to implement AJAX binding. Look at http://demos.telerik.com/aspnet-mvc/razor/grid/ajaxbinding?theme=vista.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top