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. C#
  4. OutOfRangeException

OutOfRangeException

Scheduled Pinned Locked Moved C#
databasehelptutorialquestion
4 Posts 4 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.
  • K Offline
    K Offline
    kankeyan
    wrote on last edited by
    #1

    Hello Friends, protected void grdEncounter_RowDataBound(object o, GridViewRowEventArgs e) { GridViewRow grdEditRow = e.Row; if (grdEditRow.RowType.Equals(DataControlRowType.Header)) return; grdEditRow.Cells[2].Text = grdEditRow.Cells[2].Text.Equals("1") ? "Yes" : "No"; } error comes in above line Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: index This is the error while loading itself i don't know how to solve. Regards JK

    C A G 3 Replies Last reply
    0
    • K kankeyan

      Hello Friends, protected void grdEncounter_RowDataBound(object o, GridViewRowEventArgs e) { GridViewRow grdEditRow = e.Row; if (grdEditRow.RowType.Equals(DataControlRowType.Header)) return; grdEditRow.Cells[2].Text = grdEditRow.Cells[2].Text.Equals("1") ? "Yes" : "No"; } error comes in above line Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: index This is the error while loading itself i don't know how to solve. Regards JK

      C Offline
      C Offline
      Caio Kinzel Filho
      wrote on last edited by
      #2

      seems like your grdEditRow.Cells doesn't have a cell with index = 2

      Intelligence is almost useless for those who have nothing else! Email: caiokf@gmail.com

      1 Reply Last reply
      0
      • K kankeyan

        Hello Friends, protected void grdEncounter_RowDataBound(object o, GridViewRowEventArgs e) { GridViewRow grdEditRow = e.Row; if (grdEditRow.RowType.Equals(DataControlRowType.Header)) return; grdEditRow.Cells[2].Text = grdEditRow.Cells[2].Text.Equals("1") ? "Yes" : "No"; } error comes in above line Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: index This is the error while loading itself i don't know how to solve. Regards JK

        A Offline
        A Offline
        Ashfield
        wrote on last edited by
        #3

        I suspect that grdEditRow.Cells[2] doesn't exist for some reason. Try running in debug and have a look exactly where it errors and you should be able to see the cause.

        Bob Ashfield Consultants Ltd

        1 Reply Last reply
        0
        • K kankeyan

          Hello Friends, protected void grdEncounter_RowDataBound(object o, GridViewRowEventArgs e) { GridViewRow grdEditRow = e.Row; if (grdEditRow.RowType.Equals(DataControlRowType.Header)) return; grdEditRow.Cells[2].Text = grdEditRow.Cells[2].Text.Equals("1") ? "Yes" : "No"; } error comes in above line Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: index This is the error while loading itself i don't know how to solve. Regards JK

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          You already got replies here[^], here[^] and here[^]. Please keep your question in a single thread, and follow up on the replies that you get.

          Despite everything, the person most likely to be fooling you next is yourself.

          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