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

[Solved] MVC Grid sorting doesn't happen after modifying header template

0 Answers 22 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.
akhila
Top achievements
Rank 1
akhila asked on 04 Jan 2012, 12:03 PM
Greetings All,

we are MVC grid component, after changing header template for a column, sorting doesn't work for that column.

Please do suggest us to overcome this issue

our sample code:

@{Html.Telerik().Grid<Some.SomeView.ViewModel.Common.SomeModel>()
    .Name("AS")
    .Columns(columns =>
    {
        columns.Bound(o => o.SomeName)
        .HeaderTemplate(@<text>Column head 1</text>)
        .FooterTemplate(@<text>Footer heading</text>)
        .FooterHtmlAttributes(new { @class = "footer_title" });


        columns.Bound(o => o.SomeNumber)
        .HeaderHtmlAttributes(new { @class = "some_no" })
        .HtmlAttributes(new { @class = "some_no" });


        columns.Bound(o => o.SomeAt)
        .HeaderHtmlAttributes(new { @class = "some_loc" });                                                       
                                                                   
        columns.Bound(o => o.SomeValue)
        .HeaderHtmlAttributes(new { @class = "some_val" })
        .HtmlAttributes(new { @class = "some_val" })
        .FooterTemplate(@<text><strong id="SomeValue"></strong></text>)        
        .FooterHtmlAttributes(new { @class = "some_val" });


        columns.Bound(o => o.SomeChange)
        .HeaderHtmlAttributes(new { @class = "some_chg" })
        .HtmlAttributes(new { @class = "some_chg" })
        .Format("{0:0,0.00}")
        .FooterTemplate(@<text><strong id="SomeChange"></strong></text>)                
        .FooterHtmlAttributes(new { @class = "some_chg" });


    })
   
    .ClientEvents(events => events.OnDataBinding("rAS").OnDataBinding("gAS"))
    .DataBinding(binding => binding.Ajax().Select("_GAS", "AS"))
    .Pageable(paging => paging.PageSize(5)
        .PageOnScroll(true) )           
    .Sortable(sorting => sorting
        .SortMode(GridSortMode.MultipleColumn).Enabled(true) ) 
    .Scrollable((scroll) => {
        scroll.Height(138);
    })
    .Render();
Tags
Grid
Asked by
akhila
Top achievements
Rank 1
Share this question
or