方法: 青の背景色と「チェック」チェック ボックスのデータ行を追加し、残りは青の背景色のままにします
以下の私のコードを参照してください。助けてくれてありがとう
Dim table2 As New DataTable
' Create four typed columns in the DataTable.
table2.Columns.Add("ID", GetType(Integer))
table2.Columns.Add("Drug", GetType(String))
table2.Columns.Add("Patient", GetType(String))
table2.Columns.Add("Date", GetType(DateTime))
' Add five rows with those columns filled in the DataTable.
table2.Rows.Add(25, "Indocin", "David", DateTime.Now)
table2.Rows.Add(50, "Enebrel", "Sam", DateTime.Now)
table2.Rows.Add(10, "Hydralazine", "Christoff", DateTime.Now)
table2.Rows.Add(21, "Combivent", "Janet", DateTime.Now)
table2.Rows.Add(10, "Dilantin", "Melanie", DateTime.Now)
table2.Rows.Add(125, "Indocin", "David", DateTime.Now)
table2.Rows.Add(150, "Enebrel", "Sam", DateTime.Now)
table2.Rows.Add(2, "Hydralazine", "Christoff", DateTime.Now)
'GridView1.DataSource = table2
For Each dr As DataRow In table2.Rows
If dr("ID") = 21 Or dr("ID") = 150 Then
' add a data row with a back ground colour - blue and check check box
Else
' add a data row with a back ground colour - yellow
End If
Next
GridView1.DataBind()