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. Arraylist bound to datagrid problem when arraylist is part of another class?

Arraylist bound to datagrid problem when arraylist is part of another class?

Scheduled Pinned Locked Moved C#
helpcssdatabasequestion
1 Posts 1 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
    spAAwn
    wrote on last edited by
    #1

    Hi! I have a class that looks like this: using System; using System.Collections; namespace AreaData { [Serializable()] public class Wrapper { ArrayList _Data = new ArrayList(); int _MovieLength = 0; public Wrapper() { } public Wrapper(ArrayList a, int l) { _Data = a; _MovieLength = l; } public ArrayList Data { get{return _Data;} } public int MovieLength { get{return _MovieLength;} set{_MovieLength = value;} } } } In my mainform I have a datagrid which is bound to the ArrayList of this class. Everything works fine, except when I try to change a value in the datagrid at runtime, then at first the change doesnt commit, and after that when I click somewhere else I get an error box: "Error when committing the row to the original data store" Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index. Do you want to correct the value? Everyting works fine, when the arraylist is located in the same class as the datagrid! Any solution to this would be really appreciated! thanks /Rickard

    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