Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. "Array index out of bounds exception " after Deleting last row from Datagrid

"Array index out of bounds exception " after Deleting last row from Datagrid

Scheduled Pinned Locked Moved Visual Basic
databasedata-structureshelpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    V G
    wrote on last edited by
    #1

    Hi all, I have a datagrid whose datasource is an arraylist. On deleting the last row from the arraylist and refreshing the datagrid, the datagrid is displayed fine, but on clicking on any cell on the datagrid, an "Array index out of bounds exception" is thrown. It works fine if i delete any other row from the datagrid. What can be the problem here? Thanks!!

    D 1 Reply Last reply
    0
    • V V G

      Hi all, I have a datagrid whose datasource is an arraylist. On deleting the last row from the arraylist and refreshing the datagrid, the datagrid is displayed fine, but on clicking on any cell on the datagrid, an "Array index out of bounds exception" is thrown. It works fine if i delete any other row from the datagrid. What can be the problem here? Thanks!!

      D Offline
      D Offline
      Dave Sexton
      wrote on last edited by
      #2

      My guess would be that you're asking for a row from your Array List that no longer exists.

      V 1 Reply Last reply
      0
      • D Dave Sexton

        My guess would be that you're asking for a row from your Array List that no longer exists.

        V Offline
        V Offline
        V G
        wrote on last edited by
        #3

        Actually i am deleting from the arraylist first then setting the datasource to the datagrid.Something like Datagrid1.datasource=Nothing ''Remove last row from arraylist Datagrid1.Datasource = arraylist Getting the error only for the last row though.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups