I am new to Infragistics controls. I am currently using a HierarchialDataGrid.
I found the way to obtain the datakey value for the selected row (inside the rowselectionchanged client-side event handler) for the root band using the following code.
var grid = $find("wsHierarchyEditGrid");
var rowid = grid.get_gridView().get_behaviors().get_selection().get_selectedRowsResolved()[0].get_dataKey();
But this does not work for the child band. Can someone please assist with how to retrieve the datakey value for the selected child band row?Thanks!
Hi, thanks for quick reply. You were right. I did not set the datakey for the childband. Hence it was not returning the data correctly. Now that function working. But I notice some weird behavior now.
If I keep accessing parent band rows, I get the dataKeys correctly. As soon as I access one childBand row, I get an javascript error (object variable not set) first time. Then I select another row in childBand and it works fine. The issue repeats as soon as I access a parent band row again, I get the same javascript error the first time and next selection onwards it is fine.
It appears that the grid.get_gridView() is not being initialized properly when I first access jump to a different band.Can you please suggest?
Hi,Are you sure that you set the data keys for the child bands?Nikolai DImitrov
Hi, when same code executes for the childband, I get an an value of 0, 1, 2... etc (based on the childband row index) for the child band instead of the actual datakey value. During debugging, the code breaks in the line in bold for the childrow.
Can you please advise?
var rows = grid.get_gridView().get_behaviors().get_selection().get_selectedRowsResolved();var rowid = rows[0].get_dataKey();alert(rowid);Thanks,
Hello,the function that you described should work on the child bands too. Can you provide a sample that reproduces this issue?Regards,Nikolai Dimitrov