Hi, I looked around in the help manual and found the RowSelectionChangedEventArgs (http://help.infragistics.com/Help/NetAdvantage/NET/2008.3/CLR2.0/html/WebDataGrid~Infragistics.Web.UI.RowSelectionChangedEventArgs.html) with the getSelectedRows() method.
What I basically wants to do is get the values of 2 columns of the selected row. But I can't find a proper way to get the value of the selected row out of it. I am using IE 8 beta 2 which has developer tools so I am able to see what is passed over to the evntArgs.
Here you have the javascript so far.
function WebDataGrid1_RowSelectionChanged(webDataGrid, evntArgs) { var row = evntArgs.getSelectedRows(); alert('row = ' + row); }
I tried to do row[0], row[0].key, but without any luck. I don't understand why it have to be so difficult. ;-)
So basically I would like to use the index of the selected row in the enumeration of the webdatagrid and pull out the values of column 2 and 3. Is that possible? Is there an example available?
Thanks.
Try this:
function selChanged(sender, args) {
var value=args.getSelectedRows().getItem(0).get_cellByColumn(column).get_value();
}
</script>
Thank you, why does it look always so simple at the end :-/
I improved your code by my needs. The get_value() is correct but will give you <span id="...>The text within.</span>.
Using get_element().innerText will give the needed result: The text within.
function WebDataGrid1_RowSelectionChanged(webDataGrid, evntArgs) { var column = evntArgs.getSelectedRows().getItem(0).get_cell(1).get_element().innerText; alert('column = ' + column); }