This is a migrated thread and some comments may be shown as answers.
Column lost in grid after sort with scrolling enabled...
2 Answers 27 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Michael
Top achievements
Rank 1
Michael asked on 12 Jul 2011, 06:13 PM

I have determined that when I have scrolling enabled, after an Ajax post one of my columns is lost and the cell formatting is also wrong.
(see the before and after pics)
I have double checked my model and this only occurs when the scrolling is enabled. Any ideas?

@{   
 
    Html.Telerik().Grid(Model)
               .Name("DashboardGrid")
               .Columns(columns =>
               {
                columns.Bound(o => o.ComputerId).Format("<input class=\"checkedRecords\" name=\"checkedRecords\" type=\"checkbox\" value=\"{0}\" />")
                    .Encoded(false)
                    .Width(40)
                    .Title("<input id='mastercheckbox' type='checkbox' />")
                    .HtmlAttributes(new { style = "text-align:center" })
                    .HeaderHtmlAttributes(new { style = "text-align:center", title = "Click to check or uncheck all visible rows" })
                    .Sortable(false)
                    .Filterable(false);                  
                columns.Bound(o => o.Selected).Hidden(true);
                columns.Bound(o => o.ComputerName).Filterable(false).Width(120);
                columns.Bound(o => o.Status).Width(70);
                columns.Bound(o => o.AssignedTo).HeaderHtmlAttributes(new { style = "text-align:center" }).Width(150);
                columns.Bound(o => o.ProblemTicketNumber).HeaderHtmlAttributes(new { style = "text-align:center" }).Width(110);
                columns.Bound(o => o.CreateDate).HeaderHtmlAttributes(new { style = "text-align:center" }).Format("{0:MM/dd/yy hh:mm tt}").HtmlAttributes(new { style = "text-align:center" }).Width(140);
                columns.Bound(o => o.Problem).HeaderHtmlAttributes(new { style = "text-align:center" }).HtmlAttributes(new { style = "text-overflow:ellipsis;overflow:hidden;white-space:nowrap"}).Width(110);
                columns.Bound(o => o.Resolution).HeaderHtmlAttributes(new { style = "text-align:center" }).HtmlAttributes(new { style = "text-align:center;color:#789F2C;font-weight:bold" }).Width(110);
                columns.Bound(o => o.ComputerId).Format(Html.ActionLink("Edit", "Edit", new { Id = "{0}" }).ToString())
                    .Encoded(false)
                    .Title("Edit")
                    .Width(75)
                    .HtmlAttributes(new { style = "text-align:center" })
                    .Sortable(false)
                    .Filterable(false)
                    .HeaderHtmlAttributes(new { style = "text-align:center" });
                 
            })
            .Scrollable(scrolling => scrolling.Enabled(true).Height("700px"))
            .Resizable(resizing => resizing.Columns(true))
            .Sortable(sorting => sorting.SortMode(GridSortMode.SingleColumn))
            .Pageable(page => page.PageSize(1000))
            .DataBinding(dataBinding => dataBinding.Ajax().Select("_AjaxFilterBinding", "Dashboard"))
            .ClientEvents(events => events.OnDataBinding("onDataBinding").OnRowDataBound("onRowDataBound"))
            .Filterable()           
            .Render();
 
            }

2 Answers, 1 is accepted

Sort by
0
Michael
Top achievements
Rank 1
answered on 12 Jul 2011, 06:30 PM
Upon further review it also appears to be related to the Hidden column. If I remove that it seems to function properly. Maybe I need to hide the column in some other way?
0
Rosen
Telerik team
answered on 13 Jul 2011, 06:54 AM
Hello Michael,

Could you please move the hidden column(s) at the end. When using the hidden columns it is always recommended to be last in the column's declaration list.  

All the best,
Rosen
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
Grid
Asked by
Michael
Top achievements
Rank 1
Answers by
Michael
Top achievements
Rank 1
Rosen
Telerik team
Share this question
or