ผม Select ข้อมูลได้ ตัว N มานะครับแล้วผมใช้โค้ดนี้ ถ้าตัวไหนเป็นตัว N ให้ Enable Checkbox ใน Datalist
Code (VB.NET)
Sub Check_Table()
Dim chk As String = String.Empty
Dim count As Integer = 0
For Each di As DataListItem In DataList1.Items
Dim CheckLabel As Label = DirectCast(di.FindControl("Label"), Label)
If CheckLabel.Text = "N" Then
'Enable Checkbox ใน Datalist
Else
End If
Next
End Sub
Sub Button1_Click(sender As Object, e As EventArgs)
Dim chkCate As CheckBox
Dim lblID As Label
Dim i As Integer
lblText.Text = ""
For i = 0 To myDataList.Items.Count - 1
chkCate = myDataList.Items(i).FindControl("chkCateID")
lblID = myDataList.Items(i).FindControl("lblCateID")
IF chkCate.Checked = True Then
'*** Have lblID.Text ***'
Me.lblText.Text = Me.lblText.Text & "<br>" & lblID.Text
End IF
Next
End Sub