我有一個GV手動數據綁定。但問題是,它給了我這個錯誤:Gridview事件排序不處理
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: The GridView 'gvAgentList' fired event Sorting which wasn't handled.
頁面索引相同。這裏是我寫的功能,從後面的代碼中執行:
protected void gvAgentList_SelectedIndexChanged(object sender, EventArgs e)
{
string selectedEntity; //string for Labeling in Master Page!
int selectIdEntity; //int for storing Plan IDs in Plan Page!
GridViewRow row = gvAgentList.SelectedRow;
selectedEntity = row.Cells[2].Text.ToString();
selectIdEntity = Int16.Parse(row.Cells[1].Text.ToString());
Session["EntityIdSelected"] = selectIdEntity;
Session["EntitySelected"] = selectedEntity;
Response.Redirect("~/FrontEnd/Users.aspx?EntityID=" + row.Cells[1].Text.ToString());
}
我不知道我應該在這裏使用哪個事件處理程序?它在我改變頁面索引時沒有調用這個函數!任何幫助?
謝謝巴拉,索引怎麼樣? – 2011-05-10 18:17:39
不要忘記在你的標記中添加AllowSorting = True .. – rofans91 2012-01-03 04:15:51
謝謝,我的問題 – mitchellt 2014-03-09 11:55:19