在itemcreat事件中
Button myButton = (Button) e.Item.Cells[0].Controls[0];
if(....){
myButton.Enabled = false;
}
Button myButton = (Button) e.Item.Cells[0].Controls[0];
if(....){
myButton.Enabled = false;
}
调试欢乐多
Button myButton = (Button)DataGrid1.Items[i].Cells[j].FindControl("Button");
if(....){
myButton.Enabled = false;
}
必须指定行和列Items[i].Items[i].
Sub DBGrif_OnItemDataBound(...)
If e.Item.Index<>-1 Then
CType(e.Item.FindControl("ButtonName"),Button).Enabled = false
end if
End Sub
=>>
If e.Item.Index<>-1 AND "不能用的条件" Then