Hello
I've an issue with a grid that is grouped by a column and has at least one group collapsed. In client side code, I'm handling the RowContextMenu event. There I use eventArgs.get_itemIndexHierarchical() to get the index of the row that was right clicked. This is returning the index in a way that considers the hidden rows that belong to the collapsed group(s). For example when the grid has four rows but the first three rows belong to a collapsed group and I right click the fourth row (which is the only one being displayed) eventArgs.get_itemIndexHierarchical() returns 3 which is what I'd expect.
But then I use this index to get the actual clicked DataItem using masterTableView.get_dataItems()[indexJustReturned]. But this does not return the correct item because the hidden items are not considered here. Instead nothing is returned because there is no item at position 3 when the hidden items aren't considered.
I'm not sure if this is a bug or if I'm misunderstanding anything. I've created a workaround using a for-loop that loops masterTableView.get_dataItems(). In that loop I compare the current item's _itemIndexHierarchical value with the indexJustReturned, which I don't think is nice because I'm accessing the _itemIndexHierarchical.
So how to get the item from masterTableView.get_dataItems() when there are collapsed groups?
Thank you
Christian
I've an issue with a grid that is grouped by a column and has at least one group collapsed. In client side code, I'm handling the RowContextMenu event. There I use eventArgs.get_itemIndexHierarchical() to get the index of the row that was right clicked. This is returning the index in a way that considers the hidden rows that belong to the collapsed group(s). For example when the grid has four rows but the first three rows belong to a collapsed group and I right click the fourth row (which is the only one being displayed) eventArgs.get_itemIndexHierarchical() returns 3 which is what I'd expect.
But then I use this index to get the actual clicked DataItem using masterTableView.get_dataItems()[indexJustReturned]. But this does not return the correct item because the hidden items are not considered here. Instead nothing is returned because there is no item at position 3 when the hidden items aren't considered.
I'm not sure if this is a bug or if I'm misunderstanding anything. I've created a workaround using a for-loop that loops masterTableView.get_dataItems(). In that loop I compare the current item's _itemIndexHierarchical value with the indexJustReturned, which I don't think is nice because I'm accessing the _itemIndexHierarchical.
So how to get the item from masterTableView.get_dataItems() when there are collapsed groups?
Thank you
Christian