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. System.ArgumentOutOfRangeException:

System.ArgumentOutOfRangeException:

Scheduled Pinned Locked Moved C#
databasehelpquestion
3 Posts 3 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

    Error Specified argument was out of the range of valid values. Parameter name: index while i'm loading the page, error will come in this code 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 under above line } thanks in advance

    D A 2 Replies Last reply
    0
    • K kankeyan

      Error Specified argument was out of the range of valid values. Parameter name: index while i'm loading the page, error will come in this code 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 under above line } thanks in advance

      D Offline
      D Offline
      DaveyM69
      wrote on last edited by
      #2

      kankeyan wrote:

      Specified argument was out of the range of valid values. Parameter name: index

      kankeyan wrote:

      grdEditRow.Cells[2].Text = grdEditRow.Cells[2].

      It looks like you're trying to access the 3rd cell (zero based index) which doesn't exist as the error message says. set a breakpoint on that line and examine the cells Count property.

      Dave
      BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
      Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

      1 Reply Last reply
      0
      • K kankeyan

        Error Specified argument was out of the range of valid values. Parameter name: index while i'm loading the page, error will come in this code 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 under above line } thanks in advance

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

        Already posted 3 times. Try reading the answers people give you!

        Bob Ashfield Consultants Ltd

        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