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

[Solved] Grid's First Column Sort Icon Not Removed

4 Answers 53 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.
Paul
Top achievements
Rank 1
Paul asked on 26 Aug 2010, 02:36 AM
I downloaded the latest version of the Telerik Extensions for ASP.NET MVC today (version 2010.2.825) and after installing them I noticed that the first column in my grid when sorted on would not remove it's icon.  I didn't notice this before with the pervious beta version (version 2010.2.713).

Here are the steps I took to consistantly reproduce this issue:
1. Set your grid to be SingleColumn sort mode
2. Click on the first column of your grid that is sortable.
3. Click on another column that is sortable.
4. Notice that the icon displayed to show sorting is displayed in the first column still as well as the new column.  If you step through the code there is only 1 "SortDescriptor" in the "GridCommand" so the sorting is correctly happening or I assume it is but for some reason the first column's "sort image" is not being removed.  All other columns are removed properly it just seems to be the first column.

Has anyone else seen this issue?

If you need a code example / test project let me know where to submit it and I will do so.  I recreated this by starting with a brand new "Telerik MVC Application" project.

Thanks,
Paul

4 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 26 Aug 2010, 07:15 AM
Hello Paul,

 A similar setup is demonstrated in our online demos. How is it different from yours? Can you reproduce this problem in those demos?

Best wishes,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Paul
Top achievements
Rank 1
answered on 26 Aug 2010, 03:21 PM
I cannot reproduce it in the demo but I made a new project using the demo code and I just added one column because my grid requires we have a checkbox.  When I add this column I get the behavior I described above even in my simple test project:
<%= Html.Telerik().Grid<TelerikMvcApplication1.Models.Order>()
        .Name("Grid")
        .Columns(columns =>
        {
            columns.Bound(o => o.OrderId)
                            .ClientTemplate("<input type='checkbox' name='checkedRecords' value='<#= OrderId #>' />")
                            .Title("")
                            .Width(40)
                            .Sortable(false)
                            .Groupable(false)
                            .Filterable(false)
                            .HtmlAttributes(new { style = "text-align:center" });
            columns.Bound(o => o.OrderId).Width(100);
            columns.Bound(o => o.ContactName).Width(200);
            columns.Bound(o => o.ShipAddress);
            columns.Bound(o => o.OrderDate).Format("{0:MM/dd/yyyy}").Width(120);
        })
        .DataBinding(dataBinding => dataBinding.Ajax().Select("_AjaxBinding", "Home"))
        .Pageable()
        .Sortable()
        .Scrollable()
        .Groupable()
        .Filterable()
%>

So I'm not saying it's a bug but maybe it's the way I am adding my checkbox to the grid.  Any suggestions would be greatly appreciated.  Also I am using the AjaxBinding and a ClientTemplate because eventually I am going to need to grab the checked "orders" and do something with them.  I might change that to server side at some point but we will see.  Either way I will be posting an Ajax call so I might keep the ClientTemplate for that reason alone.

Thanks again for your quick response,
Paul

0
Accepted
Atanas Korchev
Telerik team
answered on 26 Aug 2010, 03:56 PM
Hello Paul,

There seems to be a problem when there is more than one column bound to the same member (OrderID). As a workaround you can try this:

columns.Template(o => { })
    .ClientTemplate("<input type='checkbox' name='checkedRecords' value='<#= OrderID #>' />")
    .Title("")
    .Width(40)
    .HtmlAttributes(new { style = "text-align:center" });

columns.Bound(o => o.OrderID);


All the best,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Paul
Top achievements
Rank 1
answered on 26 Aug 2010, 04:24 PM
This suggestion resolved my issue.

Thanks,
Paul
Tags
Grid
Asked by
Paul
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Paul
Top achievements
Rank 1
Share this question
or