Hello ,
Thank you for using our jQuery components
You can take a look at the help article regarding
https://www.igniteui.com/help/jquery-ighierarchical-grid-selecting-and-deselecting-rows-and-cell-programmatically-in-ighierarchicalgrid
All of the code snippets use the methods described here:
https://www.igniteui.com/help/api/2019.1/ui.iggridselection_hg#methods
There is also online sample :
https://www.igniteui.com/hierarchical-grid/selection
Once you have the selected rows you can get the index or the rows.
var row = $("#grid1").igGridSelection("selectedRow"); var index = row.index;
If you have set the primary column to be hidden it won't be rendered.
Hope this helps
This mehtod (var row = $("#grid1").igGridSelection("selectedRow")) only allows for the parent object's selected rows to be returned. Can you proved the needed code to return the child object's selected rows?
Thanks a lot.
Hello,
Thank you for the follow-up.
You should use the approach used in the article below with
Iterating through the expanded child grids[code]function getSelectionOfSecondLevelChildrenRecursively() { // get all expanded child grids var childGrids = $("#grid1").igHierarchicalGrid("allChildren"); // get the selected rows $(childGrids).each(function (index, grid) { var row = $(grid).igGridSelection("selectedRow"); if (row != null) { var index = row.index; alert(row.element[0].cells[1].textContent); } }); }[/code] Let me know if you need further assistance.
Helo Geolrgieva,
Thanks for your timely response.
Eddie