要如何使當WebCheckBox == True 時, GridView 不要進入修改狀態?
可以寫在WebGridView的RowDataBound事件中
public void WebGridView1_RowDataBound(Object sender, GridViewRowEventArgs e)
{
WebCheckBox cb = (WebCheckBox)e.Row.FindControl("WebCheckBox1");
if (cb.Checked == true)
{
ImageButton btn = (ImageButton)e.Row.FindControl("ImageButton1");
btn.OnClientClick = "alert('單頭狀態巳確認,無法修改單身資料');return false;";
}
}