Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub BooksDataGridView_CellFormatting(sender As Object, e As DataGridViewCellFormattingEventArgs) Handles BooksDataGridView.CellFormatting
- For Each row As DataGridViewRow In BooksDataGridView.Rows
- If row.Cells("Edit").Value = False Then
- row.Cells(0).Style.BackColor = Color.FromArgb(0, 41, 75)
- Else
- row.Cells(0).Style.BackColor = Color.SeaGreen
- row.Cells(0).Style.SelectionBackColor = Color.MediumSeaGreen
- End If
- Next
- For i As Integer = 0 To DataGridView1.RowCount - 1
- Dim tid = DataGridView1.Rows(i).Cells(0).Value
- Dim sid = DataGridView1.Rows(i).Cells(1).Value
- Dim type = DataGridView1.Rows(i).Cells(2).Value
- For j As Integer = 0 To BooksDataGridView.RowCount - 1
- If BooksDataGridView.Rows(j).Cells(1).Value = tid And BooksDataGridView.Rows(j).Cells(2).Value = sid And type = "Book" Then
- BooksDataGridView.Rows(j).Cells("Edit").Value = True
- BooksDataGridView.Rows(j).Cells("stat").Value = 1
- End If
- Next
- Next
- 'BooksDataGridView.Sort(BooksDataGridView.Columns(20), System.ComponentModel.ListSortDirection.Descending)
- End Sub
- | Book Title Author |
- |☐ Harry Potter 1 J.k Rowling|
- |☑ Harry Potter 2 J.k Rowling|
- |☐ Harry Potter 3 J.k Rowling|
- |☑ Harry Potter 4 J.k Rowling|
- |☐ Harry Potter 5 J.k Rowling|
- |☑ Harry Potter 6 J.k Rowling|
- |☑ Harry Potter 7 J.k Rowling|
- To
- | Book Title Author |
- |☑ Harry Potter 2 J.k Rowling|
- |☑ Harry Potter 4 J.k Rowling|
- |☑ Harry Potter 6 J.k Rowling|
- |☑ Harry Potter 7 J.k Rowling|
- |☐ Harry Potter 1 J.k Rowling|
- |☐ Harry Potter 3 J.k Rowling|
- |☐ Harry Potter 5 J.k Rowling|
Add Comment
Please, Sign In to add comment