ballybeg
Member
Hi there,
I have a simple question that I cannot find the answer to after hours of googling.
I have an object: RaceMeetings that has sub objects Races that has subobjects runners.
The object populates fine.
I have a form with three dgvs - meets, races, runners. In my main form I have the following:
and all three populate fine.
I want a process where If I click on any row in the first dgv the second dgv uses the dgv1.row index as the data source as the the key for showing the data.
In the dgv.click event I added:
but I get an error:
An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll
Additional information: Index was out of range. Must be non-negative and less than the size of the collection.
I can see that the oMeetings.currentcell.rowindex is a valid integer. What am I missing?
Thanks
Grantay
I have a simple question that I cannot find the answer to after hours of googling.
I have an object: RaceMeetings that has sub objects Races that has subobjects runners.
The object populates fine.
I have a form with three dgvs - meets, races, runners. In my main form I have the following:
VB.NET:
oMeetings = TOBApiCalls.fnLoadMeets()
DataGridView1.DataSource = oMeetings
DataGridView2.DataSource = oMeetings(0).Races
DataGridView3.DataSource = oMeetings(0).Races(1).Runners
and all three populate fine.
I want a process where If I click on any row in the first dgv the second dgv uses the dgv1.row index as the data source as the the key for showing the data.
In the dgv.click event I added:
VB.NET:
DataGridView2.DataSource = oMeetings(DataGridView1.CurrentCell.RowIndex).Races
but I get an error:
An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll
Additional information: Index was out of range. Must be non-negative and less than the size of the collection.
I can see that the oMeetings.currentcell.rowindex is a valid integer. What am I missing?
Thanks
Grantay