Why does Grid DataManager read data three times?

When you first view the page, data is uploaded three times to the Grid so it contains one record three times.

However, when I switch to the next sheet, the data is being read correctly. Where could be a mistake?

The project and the result are in the attached video.

Thank you for your help and I greet you with regards

Attachment: Grid_DataManager_27be5b95.zip

3 Replies

MF Mohammed Farook J Syncfusion Team October 22, 2018 11:59 AM UTC

Hi Patrik, 
 
Thanks for contacting Syncfusion support. 
 
Query: When you first view the page, data is uploaded three times to the Grid so it contains one record three times. However, when I switch to the next sheet, the data is being read correctly. Where could be a mistake? 
 
We have validated your query and try to reproduce the reported problem at our end. But it was unsuccessful. We have prepared a sample based on your requirement. Please find the below code example and sample for your reference. 
 
[code example] [index.cshtml] 
... 
<div class="container"> 
    <ejs-grid id="Grid" allowPaging="true" toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Update", "Cancel" })" allowFiltering="true" detailDataBound="detailDataBound" detailTemplate="#detailtemplate"> 
        <e-datamanager url="/Home/UrlDatasource" adaptor="UrlAdaptor" crossdomain="true"></e-datamanager> 
        <e-grid-pagesettings pageSize="7"> </e-grid-pagesettings> 
        <e-grid-editSettings allowAdding="true" allowDeleting="true" allowEditing="true" mode="Dialog"></e-grid-editSettings> 
        <e-grid-filterSettings type="Menu"></e-grid-filterSettings> 
        <e-grid-columns> 
            <e-grid-column field="OrderID" headerText="Order ID" isPrimaryKey="true" textAlign="Right" width="100"></e-grid-column> 
            <e-grid-column field="CustomerID" headerText="Customer ID" width="120"></e-grid-column> 
            <e-grid-column field="EmployeeID" headerText="Employee ID" width="120"></e-grid-column> 
            <e-grid-column headerText="Template Column" template="#template" textAlign="Center" width="150"></e-grid-column> 
        </e-grid-columns> 
    </ejs-grid> 
    </div> 
 
<script id="template" type="text/x-template"> 
    <div> 
        temp column 
    </div> 
</script> 
 
<script type="text/x-template" id="detailtemplate"> 
    <div> 
        <div class="detail-tab"></div> 
    </div> 
    <div style="display:none"> 
        ... 
   </div> 
</script> 
 
<script> 
    function detailDataBound(e) { 
        ... 
</script> 
 
[HomeController.cs] 
... 
 
namespace TestSample.Controllers 
{ 
 
    public class HomeController : Controller 
    { 
        public IActionResult Index() 
        { 
            ... 
       } 
 
        public IActionResult UrlDatasource([FromBody]Data dm) 
        { 
            //bind your data here 
            var order = OrdersDetails.GetAllRecords(); 
            var Data = order.ToList(); 
            int count = order.Count(); 
            return dm.requiresCounts ? Json(new { result = Data.Skip(dm.skip).Take(dm.take), count = count }) : Json(Data); 
        } 
 
        public ActionResult Update([FromBody]CRUDModel<OrdersDetails> value) 
        { 
            ... 
        }  
 
        ... 
        ... 
} 
 
Please find the sample in below link. 
 
 
If you are still facing the same problem, then please provide the below information it will be helpful for provide better solution as earlier possible. 
  • Share full grid code example.
  • Share Essential Studio package version details.
  • Share the  grid sample if possible.
  • Reproduce the issue in the provided sample if possible.
 
Please get back to us If you need further assistance. 
 
Regards, 
J Mohammed Farook. 
 



PV Patrik Volka October 23, 2018 09:33 AM UTC

Good day,
I've tried to change my code to your example, but the problem with multiple item views persists.

I use Syncfusion.EJ2.AspNet.Core v16.3.0.24, MS Visual Studio 2017 v15.8.7

I'm putting Controller and View source code, video before and after code change.

Attachment: Grid_DataManager_f1a2ffda.zip


MF Mohammed Farook J Syncfusion Team October 24, 2018 01:15 PM UTC

Hi Patrik, 
 
Query: I've tried to change my code to your example, but the problem with multiple item views persists. 
 
We have validated the reported issue and tried to reproduce but it was unsuccessful at our end. In view side, Grid data is bind based on what we are returning from controller. Please check the controller side, whether the controller side code is returned data is in correct form or not(ie.. check whether it returns same data in multiple times). Please check in your controller side as like in the below screenshot. 
 
[screenshot] 
 
 
 
 
 
 
Still if you have faced same issue could you please share the your sample if it is possible or modified the attached sample with your issue. 
 
Please get back to us if you need further assistance. 
 
Regards, 
J Mohammed Farook 
 


Loader.
Up arrow icon