在rowcommand中,我已成功检测到更新,找到文本框,并更改了内容。。。。。但是现在我不能取消RowComand。。有没有办法做到这一点?
提前谢谢
请改用此方法,使用RowUpdate事件:
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e) { //Do the check. //IF check succeeds do nothing //IF check fails do this: e.Cancel = true; //Cancels the impending update. }
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridviewupdateeventargs_members.aspx )