1、设置ASPxGridView属性:
设置:
< SettingsBehavior AllowFocusedRow = "True" ProcessSelectionChangedOnServer = "True" /> |
< ClientSideEvents FocusedRowChanged = "function(s,
e) { OnGridFocusedRowChanged(); }" /> |
js代码:
<script
language= "javascript" type= "text/javascript" > |
function OnGridFocusedRowChanged()
{ |
grid.GetRowValues(grid.GetFocusedRowIndex(), 'PERNUM;PERNAME' ,
OnGetRowValues); |
function OnGetRowValues(values)
{ |
window.iAction.location.href
= "iAction.aspx?PerNum=" +
values[0]; |
这样便可以在焦点行改变时,写js事件。
但是,还有一个问题,就是在点击分页按钮时,没有触法该事件,需要另加判断获取。