Tuesday 11 March 2014

Tick Rows In Datagridview Value

 Private Sub DataGridView2_CellClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView2.CellClick
        If e.RowIndex < 0 Then Exit Sub
        If e.ColumnIndex < 0 Then Exit Sub
        If DataGridView2.Columns(e.ColumnIndex).Name = "Select" Then
            If DataGridView2.Rows(e.RowIndex).Cells("Select").Value = "P" Then
                DataGridView2.Rows(e.RowIndex).Cells("Select").Value = ""
            Else
                DataGridView2.Rows(e.RowIndex).Cells("Select").Style.Font = New Font("Wingdings 2", 10, FontStyle.Bold)
                DataGridView2.Rows(e.RowIndex).Cells("Select").Value = "P"
            End If
        End If
    End Sub

No comments:

Post a Comment

Followers