Dim ch As CheckBoxFor Each dlitem In mydg.Items
ch = CType(dlitem.Cells(0).FindControl("rb"),CheckBox)
IF(ch!=null)
Then
If ch.Checked Then
warn.showmsg(Me, "OK")
Else
warn.showmsg(Me, "false")
End If
End If Next
ch = CType(dlitem.Cells(0).FindControl("rb"),CheckBox)
IF(ch!=null)
Then
If ch.Checked Then
warn.showmsg(Me, "OK")
Else
warn.showmsg(Me, "false")
End If
End If Next
ch = CType(dlitem.Cells(0).Controls("rb"), checkbox)试试
http://www.aspx.cn/comm/dotnetbbs/Showtopic.aspx?Forum_ID=5&Id=48649&PPage=1
这句不行的,checkbox没有这种属性。ch = CType(dlitem.Cells(0).Controls("rb"), checkbox)
输入字符串的格式不对
If CType(item.FindControl("ci"), CheckBox).Checked Then
.....
end if
next
注意:不要在POSTBACK时再次绑定DATAGRID 否则你是选不中CheckBox的
这句何解?页面导入时要绑定datagrid吧。
{If(!Page.IsPostBack)
{
BindChecBox();
}}
你如果在postback之后再绑定checkbox,那么checkbox数据就没有修改,所以每次就显示一样啊