I have a GridButtonColumn with ButtonType="ImageButton". I'm accessing the button click client side with OnCommand of the RadGrid.
<
ClientSettings
>
<
ClientEvents
OnCommand
=
"OnCommand"
/>
</
ClientSettings
>
I know I can get the row through args.get_commandArgument(), but this is the row of the Master Table and works fine if my grouped table doesn't have a collapsed grouping, but fails horribly when there is a collapsed group.
<script type=
"text/javascript"
>
function
OnCommand(sender, args) {
var
rowIndex = args.get_commandArgument();
// getting row index
var
itemValue = masterTable.getCellByColumnUniqueName(masterTable.get_dataItems()[row],
"itemName"
).innerHTML;
}
</script>
For example, the rowIndex is determined to be 20 and and there are no collapsed rows so masterTable.getCellByColumnUniqueName(masterTable.get_dataItems()[row], "itemName").innerHTML return the correct row and value. But say a group above has 10 rows collapsed then the 20 referes to something 10 down the table. The rowIndex value in this instance needs to be 10.
So . . . what am I doing wrong. How to account for the collapsed rows? Should I be doing this differently?
TIA - Shawn