Remove race on "inplay"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tippete
    Junior Member
    • Mar 2016
    • 42

    #1

    Remove race on "inplay"

    I have a DataGridView with all todays GB races.
    There is a column that is blank that changes to "inplay" when the race is off.
    What i would like to do is remove the runners from that race when it goes into play.

    The races are in date order, so i thought if i could remove the races one at a time it would stop at the next race.

    I have made a subroutine with a time to check for inplay and here is the sub.

    Private Sub RemoveInplay()
    If DataGridView1.Rows(0).Cells(3) Is "inplay" Then
    DataGridView1.Rows.RemoveAt(0)
    End If

    End Sub

    I get the outOfRange Exception

    Anyone any ideas.
  • tippete
    Junior Member
    • Mar 2016
    • 42

    #2
    looking around for inspiration , i found that i could close a second form easily. so i decided to put the datagridview on form2. I have played round with the code and get a datagrid but then it gives an exception. Missing primary key. Considering this worked before i messed with it and when i scroll over the values i can see the marketId and selectionId. Maybe someone will be kind and tell me whats wrong.
    You do not have permission to view this gallery.
    This gallery has 1 photos.

    Comment

    • jabe
      Senior Member
      • Dec 2014
      • 705

      #3
      You say the rows in your race DGV are in date order, but don't say whether the earlier ones are at the top or bottom of the DGV.

      It looks like you're going through all races and all runners within each race, but most of your code is covered up, so I can't work out what you're trying to achieve. I don't know what the line filling up foundrows - where the error message is coming up - is intended to do.


      Comment

      Working...
      X