This is a migrated thread and some comments may be shown as answers.

Select a row value by key enter (cliente side)

2 Answers 34 Views
Grid
This is a migrated thread and some comments may be shown as answers.
jolynice
Top achievements
Rank 1
jolynice asked on 07 Jan 2011, 04:15 AM
Hello Sir.

I would like to retrieve the value of the seletect row, i have  AllowKeyboardNavigation="true"   and i catch the key enter  
<ClientEvents OnRowDblClick="RowDblClick" OnKeyPress="KeyPress"></ClientEvents>  

When the enter key is pressed i want to go to another detail page based of the value of the row selected.

With RowDblClick i achived correctly but with the event onKeypress i donĀ“t.

Can you help me.

Thanks.


  function RowDblClick(sender, eventArgs)
 {                       
             PacienteId = eventArgs.getDataKeyValue("CustomerID"));
 }

function KeyPress(sender, eventArgs)
{
  ?????????
}

2 Answers, 1 is accepted

Sort by
0
Accepted
Brian
Top achievements
Rank 1
answered on 07 Jan 2011, 04:27 AM

Hi there

I just tried the code as follows and it's working for me (ClientDataKeyNames="itemID"):

<ClientEvents OnRowClick="RowClicked" OnKeyPress="keyPress" />

<script type="text/javascript">

function keyPress(sender, args) {
var grid = $find("<%=grid_items.ClientID %>");
var masterTableView = grid.get_masterTableView();
var id = masterTableView.get_selectedItems()[0].getDataKeyValue('itemID');
alert(id);
}

</script>

Try it out and let me know...

Brian

0
jolynice
Top achievements
Rank 1
answered on 09 Jan 2011, 12:42 AM
Hi Brian..

Work like a charm. :)

Thanks
Tags
Grid
Asked by
jolynice
Top achievements
Rank 1
Answers by
Brian
Top achievements
Rank 1
jolynice
Top achievements
Rank 1
Share this question
or