I am using Infragistics webdatagrid v11.1.For eg: I have 3 columns id, name,gender in my webDG. When I double click on any of the rows, I want the row ID to be retrieved. I have achieved this using the below code.It works fine only if I click on the row elements. But when I dblclick on the row selector tab (leftmost) or the table header it throws a js exception( Microsoft JScript runtime error: Object doesn't support property or method 'get_row). Please help on resolving this issue.
I want to do the same function when a row is dblClicked / when row selector is dblclicked.
<ig:WebDataGrid ID="WebDataGrid1" runat="server" Height="350px" Width="400px" ViewStateMode="Enabled" EnableAjax="False" ClientEvents-DoubleClick="webDataGrid_DblClick1">
Corresponding javascript function:
<script type="text/javascript" id="webGridScr"><!-- function webDataGrid_DblClick1(sender, eventArgs) { var newSelectedCell1 = eventArgs.get_item().get_row().get_cellByColumnKey("RowID").get_text(); var newSelectedCell2 = eventArgs.get_item().get_row().get_cellByColumnKey("Name").get_text(); alert("the value is" + newSelectedCell1 + newSelectedCell2); form1.submit(); } //--></script>
Hello prathi84,
If you need further assistance on the matter, please do not hesitate to ask.
Hi prathi84,
Thank you for posting in our forum.
If you want to use the DoubleClick client-side event, I would suggest you to use the following code to get the value from the first cell of the selected row:
function doubleClick(sender, eventArgs) {
var selectedRow = sender.get_behaviors().get_selection().get_selectedRows(0);
var IDValue = selectedRow.getItem(0).get_cellByColumnKey("ID").get_text();
alert('The value is: ' + IDValue);
}
It seems to me that there is no double click event of the row selectors. However, there is RowSelectorClicked event:
<Behaviors>
<ig:RowSelectors>
<RowSelectorClientEvents RowSelectorClicked="rowSelectorClicked" />
</ig:RowSelectors>
</Behaviors>
And the handler should look something like the following:
function rowSelectorClicked(sender, eventArgs) {
var IDValue = eventArgs.get_row().get_cellByColumnKey("id").get_text();
alert('The value is: ' + IDValue)
Please let me know if this helps.