Is there a way to get the row data when the grid is grouped by a column. We can get the row as shown below but when we then try to get the data for the row by index it does not work correctly when the grid has a group by a column. If you remove the grouping we can get the data just fine.
var row = $('.selector').igGrid('selectedRow');
var
row = $('.selector').igGrid('selectedRow');
$('.selector').data('igGrid').dataSource.dataView()[row.index];
Here we are looking for solution that gives us data for row selection for all below scenario
1.Normal grid
2.Grouped grid
3.Filtered grid
4.Grouped & filtered grid
Thanks!
MD
This solution will not work because the index retrieved in this scenario is the grid index (from the grouping) and not the data source index. Are there different index properties to differentiate between this like there are in the WPF and Winforms grids?
Hello Tammy,
Thank you for posting in our forums! The row index is not the same as your expected because the group rows are taken into account. The simplest workaround is to get all of the grid’s rows and exclude the group rows. Then you can find the index of the selected row in the array of “data” rows. And this will be the index that you will use to get the row from the data view. I prepared a small sample page that demonstrates my solution. Please let me know if this works for you!
I’m looking forward to your reply!
Kind regards, Petko Zhekov Software Engineer