Menu

Control Issues

Developers
Rogue3ch0
2009-02-02
2013-04-17
  • Rogue3ch0

    Rogue3ch0 - 2009-02-02

    First off I would like to start by saying I really appreciate the development that is being done on this control, this is an incredible hybrid control which greatly helps me in my development environment.

    There are a few issues which I would like to mention for the sake of the controls stability. 

    Detailed Event Handlers:  There are quite a few event handlers which are very generic, it would be nice if custom event handlers were created to handle item click etc so developers can obtain the exact row that was selected from the event handler object.

    Collections Issue:  I have noticed some odd behavior with various collections used by the control. 

    If I create a new container listview item in memory and add its sub items then add the item to another parent item everything works fine however if I also add child items to the item held in memory and child items to those items the application will crash due to an object reference error.  If I simply add the original item to its parent item first and then add sub items and child items, etc. then everything works fine.  (this does not occur on any specific line within my code, I believe it is an error within the control)

    There is another collection issue that occurs when I add items to the container listviews selected item collection manually which I am still trying to nail down.  It seems as though if I manually add items to the selecteditems collection using lsvTree.SelectedItems.Add(item) and then I attempt to indent those items by creating copies of them and removing the originals when the originals are removed and the function is finished the application throws an object reference exception.  (this does not occur on any specific line within my code, I believe it is an error within the control)

    Vertical Scroll Issue:  The container listview's vertical scroll is very jumpy (not critical, hurts the eyes a little).

    I hope this information helps, I am using almost every aspect of the control in an attempt to create a MS-Project like task tree (more structured) with the possibility for an infinite number of nodes using lazy loading.

    Nick

     
    • Rogue3ch0

      Rogue3ch0 - 2009-02-05

      As it turns out the real problem with the collections seems to exist when adding a new item to the treelistview using lsvTree.items.insert(index, text) instead of lsvTree.items.add(text).  It seems as though when insert is used items no longer have updated knowledge of their parent items, previous items etc.  If I remove an item and insert it an item below then attempt to move another item above it it will dissapear.

      Nick

       
    • Rogue3ch0

      Rogue3ch0 - 2009-02-05

      I believe I have fixed one of the issues above by updating the insert method of the ContainerListViewItemCollection Class - see the code below.

              public void Insert(int index, ContainerListViewItem item)
              {
                  if (item == null)
                      throw new ArgumentNullException("item");

                  if (_data.Count != 0 && index > 0)
                  {
                      ContainerListViewItem previousItem = _data[index - 1] as ContainerListViewItem;
                      item.InternalPreviousItem = previousItem;
                      previousItem.InternalNextItem = item;
                  }
                  if (_data.Count - 1 >= index)
                  {
                      ContainerListViewItem nextItem = _data[index] as ContainerListViewItem;
                      item.InternalNextItem = nextItem;
                      nextItem.InternalPreviousItem = item;
                  }

                  lock (_data.SyncRoot)
                      _data.Insert(index, item);

                  item.InternalParentItem = _owningItem;
                  item.OwnerListView = _listView;
           }

      Added the line nextItem.InternalPreviousItem = item; because it looked as though the previous item was being set on the new item, the next item was being set on the previous item, but the previous item was not being set on the nextItem... I had to pull down a copy of the 0.1.2.1 source code instead of the latest 0.1.2.2 so the code above may be out of date, none-the-less the bug existed in both builds.

      Nick

       
    • Rogue3ch0

      Rogue3ch0 - 2009-02-05

      From what I can tell so far the change to the insert method seems to have fixed all the collection issues I was experiencing.

      Nick

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.