前台代码:<ClientSideEvents FocusedRowChanged="FocusedRowChanged" SelectionChanged="RowSelectionChanged" />
行焦点事件:
function FocusedRowChanged(s, e) {
var SelectIndex = s.focusedRowIndex;
if (SelectIndex >= 0 && (s.pageRowCount + s.visibleStartIndex) > SelectIndex) {
type = s.keys[SelectIndex - s.visibleStartIndex];
}
}
行选择事件:
function RowSelectionChanged(s, e) {
var SelectIndex = e.visibleIndex;
var CurPartyCode = s.keys[SelectIndex - s.visibleStartIndex] + ":";
//选择状态.
if (e.isSelected) {
if (PartyJoinCode.indexOf(CurPartyCode) == -1) {
PartyJoinCode = PartyJoinCode + CurPartyCode;
}
}
else//未选中状态.
{
var index = PartyJoinCode.indexOf(CurPartyCode);
var length = PartyJoinCode.length;
if (index != -1) {
PartyJoinCode = PartyJoinCode.replace(CurPartyCode, "");
}
}
}
后台代码:string mPartyJoinCode = Request["PartyJoinCode "].ToString();
string[] nPartyJoinPartyJoinCode = mPartyJoinCode .Split(new char[]{':'}); //拆分学号字符串