![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I want to double click on a row within the grid and have it take me to a edit screen for that row. Currently I allow the user highlight a row and click the Edit Button and that takes them to a edit screen, can I have it work the same way if they double click the row? |
#3
| |||
| |||
|
|
Yes. In the ItemDataBound event setup client-side event like this: e.Item.Attributes["ondblclick"] = "onDblClick(this)"; And provide a javascript event handler: function onDblClick(row) { document.getElementById("inpRowId").innerText=row. cells(0).innerText; document.getElementById("btnEdit").click(); } Note following points: 1. The first line of the function assign row id to a <input type=hidden control to send the row id to the server. It is assumed that the first column of the grid contains row id. You can make this column invisible with stylesheet attribute display:none. Don't hide it on the server side. 2. The second line of the script simulates pressing your Edit button which should cause a postback. Eliyahu. "Mike" <anonymous (AT) discussions (DOT) microsoft.com> wrote in message news:Or7l3MIWEHA.4048 (AT) TK2MSFTNGP12 (DOT) phx.gbl... I want to double click on a row within the grid and have it take me to a edit screen for that row. Currently I allow the user highlight a row and click the Edit Button and that takes them to a edit screen, can I have it work the same way if they double click the row? |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |