Child mapping issue with Tree Grid

Hello everyone, 

I am new to using Syncfusion and am running into a into a bit of a problem trying to get a Treegrid going. When I attempt to use childMapping, i get numerous blank rows and the objects are not grouping the way that they should be.

I have a list of objects being rendered. This is the object type - 

public class Metar()

{

 public string StationId;

public double TempC;

public double DewPoint;

public double PrecipIn;

public string RawText;

}

I set the tree grid up like this:

<div class="tree-grid">
<ejs-treegrid id="TreeGrid" dataSource="@Model.Metars" childMapping="StationId" treeColumnIndex="0">
<e-treegrid-columns>
<e-treegrid-column field="StationId" headerText="Station Id"></e-treegrid-column>
<e-treegrid-column field="ObservationTime" headerText="Report Time" format="MM/dd/yyyy hh:mm"></e-treegrid-column>
<e-treegrid-column field="TempC" headerText="Temperature (Celsius)"></e-treegrid-column>
<e-treegrid-column field="PrecipIn" headerText="Precipation (Inches)"></e-treegrid-column>
<e-treegrid-column field="RawText" headerText="Raw Metar Text"></e-treegrid-column>
</e-treegrid-columns>
</ejs-treegrid>
</div>


I was expected the tree grid to group all the data rows on the StationId column. Technically that is happening, but when I click on the arrow by the StationId, it displays only 1 new row of data, and you have to keep clicking to see them all. Then, in between StationId's, there are 5-6 blank rows just sitting there. I have also tried Grouping the records in a LINQ query by StationId and rendering that, but I get a "No records to display" message instead. Would anyone happen to have any ideas or advice for me?


1 Reply

PS Pon Selva Jeganathan Syncfusion Team May 9, 2022 02:12 PM UTC

Hi John,


Thanks for contacting syncfusion forum.


Query: Child mapping issue with Tree Grid


Based on your query, we prepared a simple sample using childMapping property of the treegrid but we were unable to reproduce the issue at our end.


Please refer to the below sample,

https://www.syncfusion.com/downloads/support/directtrac/general/ze/Hover-1592493094


After following the above reference, still faced issue please share us the following details.


  1. Kindly share the complete code example(including data details)
  2. Share the product version details
  3. Share the issue reproducible sample or reproduce the issue in our shared sample.


The provided information will be helpful to provide you response as early as possible. 


Regards,
Pon selva


Loader.
Up arrow icon