Simple: setting the DataSource does not immediately load the Grid with data - it signals a
DataSourceChanged event[
^] to the Grid which causes it to load itself. Since you are inside an event handler, the event is queued for after the current handler finishes.
Until then, you can't use the data in the Grid, because it isn't loaded yet.
Move your code to use it into the Form.Shown event instead, and it should work.