0

When I instantiate a new Windows Form with a DataGridView I always seem to get a Null Pointer exception when I try to set the data source like so:

dgvOpenRequests.DataSource = lstRequest

Normally this would be an obvious problem but its the DataSource that is the null pointer and not the list I am setting it as. And once the exception error has disappeared (We have customer error handling.) the program displays exactly as I would expect it to.

Setting the data source happens after:

InitializeComponent()
Victor Zakharov
  • 25,801
  • 18
  • 85
  • 151
user1708468
  • 195
  • 10

0 Answers0