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
  • 24,856
  • 17
  • 77
  • 143
user1708468
  • 185
  • 9

0 Answers0