If e.ColumnIndex = 1 Then Dim IsChecked As Boolean = False IsChecked = CBool(DirectCast(DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells("No Records"), DataGridViewCheckBoxCell).EditedFormattedValue) If IsChecked Then DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells("Att. (Y/N)").Value = "Y" DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells("Att. (Y/N)").ReadOnly = True DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells("Mid. Wk. Call (Y/N)").ReadOnly = True DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells("Wkly Sum. (Y/N)").ReadOnly = True DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells("Shake /Cereal").ReadOnly = True DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells("Entrees").ReadOnly = True DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells("Bars").ReadOnly = True DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells("Total").ReadOnly = True DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells("Total V/F").ReadOnly = True DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells("Total PA").ReadOnly = True DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells("TI (Y/N)").ReadOnly = True DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells("# days of RT").ReadOnly = True DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells("# days of Stretch").ReadOnly = True DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells("Weight Change").ReadOnly = True Else DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells("Att. (Y/N)").Value = "" DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells("Att. (Y/N)").ReadOnly = False DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells("Mid. Wk. Call (Y/N)").ReadOnly = False DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells("Wkly Sum. (Y/N)").ReadOnly = False DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells("Shake /Cereal").ReadOnly = False DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells("Entrees").ReadOnly = False DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells("Bars").ReadOnly = False DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells("Total").ReadOnly = False DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells("Total V/F").ReadOnly = False DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells("Total PA").ReadOnly = False DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells("TI (Y/N)").ReadOnly = False DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells("# days of RT").ReadOnly = False DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells("# days of Stretch").ReadOnly = False DataGridView1.Rows(DataGridView1.CurrentRow.Index).Cells("Weight Change").ReadOnly = False End If End If End Sub Dim countCall1 = 0 Dim countCall2 = 0 For Each r As DataRow In myTable.Rows Dim YesNo As String = r.Item("Mid. Wk. Call (Y/N)").ToString.ToUpper If YesNo = "Y" Then countCall1 += 1 If YesNo = "N" Then countCall2 += 1 Next Me.txtPhonecall.Text = Math.Round((countCall1 / (countCall1 + countCall2)) * 100,
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)