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. Web Development
  3. ASP.NET
  4. Error: Index was out of range. Must be non-negative and less than the size of the collection

Error: Index was out of range. Must be non-negative and less than the size of the collection

Scheduled Pinned Locked Moved ASP.NET
helpcssdatabase
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.
  • S Offline
    S Offline
    sheringkapoting
    wrote on last edited by
    #1

    I have a function in which I bind my Gridview with the Datalist according to the info that i get from the Row in Datalist My Code Behind function is:

    protected void dtlGradeMaster\_ItemDataBound(object sender, DataListItemEventArgs e)
    {
      GridView grdGradeDetails = (GridView)e.Item.FindControl("grdGradeDetails");
      BindDetailGrid(grdGradeDetails, dtlGradeMaster.DataKeys\[e.Item.ItemIndex\].ToStrin()); 
    }
    
    private void BindDetailGrid(GridView GridView, string strGrade) 
    {
        DataTable GridData = GridDataSource(strGrade);
        GridView.DataSource = GridData; 
        GridView.DataBind(); 
    }
    

    But it gives me the Fallowing Error plss help...

    H 1 Reply Last reply
    0
    • S sheringkapoting

      I have a function in which I bind my Gridview with the Datalist according to the info that i get from the Row in Datalist My Code Behind function is:

      protected void dtlGradeMaster\_ItemDataBound(object sender, DataListItemEventArgs e)
      {
        GridView grdGradeDetails = (GridView)e.Item.FindControl("grdGradeDetails");
        BindDetailGrid(grdGradeDetails, dtlGradeMaster.DataKeys\[e.Item.ItemIndex\].ToStrin()); 
      }
      
      private void BindDetailGrid(GridView GridView, string strGrade) 
      {
          DataTable GridData = GridDataSource(strGrade);
          GridView.DataSource = GridData; 
          GridView.DataBind(); 
      }
      

      But it gives me the Fallowing Error plss help...

      H Offline
      H Offline
      Hum Dum
      wrote on last edited by
      #2

      Check this, if it helps

      S 1 Reply Last reply
      0
      • H Hum Dum

        Check this, if it helps

        S Offline
        S Offline
        sheringkapoting
        wrote on last edited by
        #3

        Thanks... Its working now...

        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