Hello,
I have a service which returns IEnumerable<ReportDetail> , I want to load these details into a nested grid in my Hierarchy Grid. Currently I can load the details on page load and it works fine but I would rather load the details when you actually click to open up the nested grid.
Ideally I would like an event I can use to load my data when the grid is expanded.
My service does not seem to work with the SFDatamanager.
Hi, I have one follow up question, when expanding one row on a hierarchical grid, can i programmatically
close any others which are opened?
I would like to keep max one row opened.
|
public async Task RecordClickHandler(RecordClickEventArgs<EmployeeData> args)
{
await Grid.ExpandCollapseDetailRowAsync(args.RowData);
}
[detailexpand.js]
var dotnetInstance;
function detail(dotnet) {
dotnetInstance = dotnet; // dotnet instance to invoke C# method from JS
}
document.addEventListener('click', function (args) {
if (args.target.classList.contains("e-dtdiagonaldown") || args.target.classList.contains("e-detailrowexpand")) {
dotnetInstance.invokeMethodAsync('DetailCollapse'); // call C# method from javascript function
}
})
|
Hi,
Your sample app is throwing a javascript error:
Uncaught TypeError: Cannot read properties of null (reading 'addEventListener')
at detailexpand.js:7:38
Hi,
How does this work if i want to display the child Grid component? Also i want to build a component where it can handle like nth level of hierarchy. Like a Grid within Grid within Grid as long as there is a level.
Really Appreciate any suggestion or examples you have.
Thanks
Hi Mag,
Greetings from Syncfusion
We have prepared an simple sample with nested detail template which collapses on expanding other rows. You can handle the same for all other levels of nested Grid. Kindly check the attached sample for additional information.
Please let us know if you face any difficulties or if you have further queries.
Regards,
Monisha