I have a CheckBoxColumn in a DataGridView, and I am trying to fill the CheckBoxColumn with an unchecked box every time my SQLReader.Read() is true (If SqlReader.Read is called 10 times in the loop, there should be 10 checkboxes). This is the code I have so far which is wrong:
DataGridView1.DataSource = sqlReader
Using sqlReader As SqlDataReader = sqlCommand.ExecuteReader
If sqlReader.HasRows Then
While sqlReader.Read
DataGridView1.Refresh()
End While
End If
End Using
I have found a way to add the checkboxes without databinding the sqlReader to a column, but I just want to know if it is possible to do it this way. I can't figure out how to bind the SqlReader to a specific column. Thank you.
Edit: After looking into it more, I think I need separate checkbox and textbox columns

SQLReader.Read()represent? If it is just that the action took place, it will alwsys be true since it is insidesqlReader.HasRows(assuming the query is not duplicated)