Dim chkCusID1 As RadioButton
Dim chkCusID2, chkCusID3 As RadioButton
Dim i As Integer
lblsCore.Text = ""
For i = 0 To GridView1.Rows.Count - 1
chkCusID1 = CType(GridView1.Rows(i).FindControl("c1"), RadioButton)
chkCusID2 = CType(GridView1.Rows(i).FindControl("c2"), RadioButton)
chkCusID3 = CType(GridView1.Rows(i).FindControl("c3"), RadioButton)
If chkCusID1.Checked = True Then
'*** Have lblID.Text ***'
Me.lblsCore.Text = "1.00"
lblidcore.Text = lblID.Text
score = CDbl(lblsCore.Text)
GridView1.Rows(i).BackColor = Drawing.Color.Green
ElseIf chkCusID2.Checked = True Then
'*** Have lblID.Text ***'
Me.lblsCore.Text = "1.50"
lblidcore.Text = lblID.Text
score = CDbl(lblsCore.Text)
GridView1.Rows(i).BackColor = Drawing.Color.Green
' insertdetail()
ElseIf chkCusID3.Checked = True Then
'*** Have lblID.Text ***'
Me.lblsCore.Text = "2.00"
lblidcore.Text = lblID.Text
score = CDbl(lblsCore.Text)
GridView1.Rows(i).BackColor = Drawing.Color.Green
End If
Next
If GridView1.Rows(i).BackColor = Drawing.Color.Green = True Then
Button2.Enabled = True
End If
เงื่อนไขข้างบนได้ แต่ตรง
If GridView1.Rows(i).BackColor = Drawing.Color.Green = True Then
Button2.Enabled = True
End If
ที่จะเช็คว่าถ้าเป็นสีเขียวหมดทุกแถวให้เปิดปุ่ม แต่มัน error ตรง If GridView1.Rows(i).BackColor = Drawing.Color.Green = True Then ไม่ทราบว่าเราควรเช็คอย่างไร