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

Grid Data looks jumbled before formatted

8 Answers 56 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 28 Jul 2015, 06:38 PM

I have a data of about 1000 rows, about a dozen columns wide that I am populating to a grid.  However the grid data looks all jumbled for a few seconds before the grid is transformed and formatted the way it should.  Is there anyway to hide or fix this?

 

 

8 Answers, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 30 Jul 2015, 01:05 PM

Hello Paul,

The problem occurs since the browser encounters some difficulties to render row elements for all data. In such case I would suggest make the Grid page-able so it will render only the current potion of data instead all of it.

 

@(Html.Kendo().Grid<KendoGridAjaxBinding.Models.Product>()
      .Name("grid")
     ....
      .Pageable() // Enable paging
)

 

By default the Grid for ASP.NET MVC enables the server operations, so paging will be handled on the server. In order to avoid server operations you can set ServerOperations(false).

.DataSource(dataSource => dataSource // Configure the grid data source
          .Ajax() // Specify that ajax binding is used
          .ServerOperation(false)
          .Read(read => read.Action("Products_Read", "Home")) // Set the action method which will return the data in JSON format
       )

  

 

Regards,
Boyan Dimitrov
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Paul
Top achievements
Rank 1
answered on 30 Jul 2015, 03:14 PM
As you can see below, I already had the pageable() option set.

Thanks.

@(Html.Kendo().Grid(Model)
    .Name("grid")
    .Columns(columns =>
    {
        about 12 columns
    })
    .Groupable()
    .Filterable()
    .Selectable(selectable => selectable
        .Mode(GridSelectionMode.Single).Type(GridSelectionType.Cell))
    .Sortable(sortable => sortable
        .SortMode(GridSortMode.MultipleColumn))
    .Pageable(pageable => pageable
        .Refresh(true)
        .PageSizes(true)
        .ButtonCount(5))
    .Events(events => events.Change("onChange"))
    .DataSource(dataSource => dataSource
        .Ajax()
        .Sort(sort => sort.Add("Code").Ascending())
        .ServerOperation(false)
        .PageSize(50)       
    )
    )
0
Boyan Dimitrov
Telerik team
answered on 03 Aug 2015, 01:57 PM

Hello Paul,

Please find attached a sample project with Grid bound to Model with 10 fields and about 1000 records. The paging is enabled and the grid table is rendered right away. 

Could you please clarify whether there are templates used in the columns definition with some complex logic? 

 

Regards,
Boyan Dimitrov
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Paul
Top achievements
Rank 1
answered on 03 Aug 2015, 03:46 PM

yes I have 3 ClientTemplates.

 

columns.Bound("").Locked(true).Filterable(false).Sortable(false).ClientTemplate("<img height='30' width='44' src='/images/" + "#= Code#.png'/>").Width(75).Title("").Groupable(false);
 
columns.Bound("").ClientTemplate("#=Conference#, #=Association# (#=Division#)").Title("Conference");
 
columns.Bound("").HtmlAttributes(new { @class = "k-group-cell" }).Width(60).Title("").Filterable(false).Sortable(false).Groupable(false)
.ClientTemplate(
@"<div class='btn-group'>
   <button type='button' class='btn btn-success dropdown-toggle'
        data-toggle='dropdown' aria-expanded='false'>
    Action <span class='caret no-margin-top'></span>
   </button>
   <ul class='dropdown-menu' role='menu'>
     <li><a href='/Test/TestInfo/#=Code#'>Info</a></li>
     <li class='divider'></li>
     <li><a href='/Test/Restrict/#=Code#'>Restrict</a></li>
     <li class='divider'></li>
     <li><a href='/Test/Person/#=Code#'>Person</a></li>
     <li class='divider'></li>
     <li><a href='/Test/Support/#=Code#'>Support</a></li>
     <li class='divider'></li>
     <li><a href='/Test/Schedule/#=Code#'>Schedule</a></li>
   </ul>
</div>");
0
Paul
Top achievements
Rank 1
answered on 03 Aug 2015, 03:48 PM
If I comment out the first ClientTemplate with the image the data seems to load instantly.  Is there a way to load the images async so that the table loads like it should?
0
Boyan Dimitrov
Telerik team
answered on 05 Aug 2015, 02:40 PM

Hello Paul,

 

Could you please confirm that the problem consists in the fact that at first the images are not loaded (showing indication when an image could not be displayed) and after that the image is displayed? Also please clarify what is the size of each image. 

 

 

 

 

Regards,
Boyan Dimitrov
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Paul
Top achievements
Rank 1
answered on 05 Aug 2015, 04:12 PM

Boyan,

I captured a screenshot of how the data is displayed at first and a second shot of the final form. It's not that the image isn't loading. The formatting around the data seems to take awhile to apply even on very fast machines.

 

0
Boyan Dimitrov
Telerik team
answered on 07 Aug 2015, 09:00 AM

Hello Paul,

I would like to clarify that we are not aware of such behavior. It seems that all filed values from the model are rendered at first in the columns with ClientTemplate. 

Since I am not able to replicate such problem at my side I would need an isolated runnable example in order to investigate it. 

Finally something that I would recommend is to update to the latest official release 2015 Q2 SP1 version if you are currently using an older version. I am not sure that if this will help, but you can try it before sending a project. 

Regards,
Boyan Dimitrov
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Paul
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Paul
Top achievements
Rank 1
Share this question
or