Menu

How to clear all data from ObjectListView ??

DrakMrak
2010-01-28
2012-10-30
  • DrakMrak

    DrakMrak - 2010-01-28

    all data or all row...

    I have some List<type> data
    I add this list to ObjectListView object olv by </type>

    .....
    olv.SetObjects( data)

    all is OK objects add to olv and show corectly

    now i need completly clear

    I tryiing

    olv.Clear()
    or
    olv.SetObject(null)

    but this don't working ?? or I making something wrong...

     
  • Phillip Piper

    Phillip Piper - 2010-01-28

    Try olv.Objects = null;

    Clear() comes from ListView and is the nuclear option!

     
  • DrakMrak

    DrakMrak - 2010-01-28

    Thanks a lot :-)
    One question more... it is possible sort after start olv another column than
    first...
    I dont find possibility that programaticaly change sorted column...

     
  • Chris B

    Chris B - 2010-02-19

    Clear() doesn't work for me, but this does:

    olv.ClearObjects();
    olv.Items.Clear();
    olv.Columns.Clear();

    But, that is when I'm using Generator.GenerateColumns().

    Chris

     
  • T Ng

    T Ng - 2010-02-24

    I have a lot of trouble using ClearObjects() with a TreeListView and spent a
    lot of time debugging the issue ( I though ) from my part of code. Finally I
    digged into the source and found out that this method simply call SetObjects
    with an empty List. It should work. However, there're also the
    mapObjectToBranch and the mapObjectToIndex dictionaries to reset otherwise you
    will have funny results trying to update data to a TreeListView. For testing I
    reset those two dictionaries when the SetObjects is called and it works
    nicely. I don't know if this is a bug or it was intended that way.

     
  • DrakMrak

    DrakMrak - 2010-03-17

    Now I haven't problem with clear ... all working very good
    This were my firsteps problems :-)

     

Log in to post a comment.

MongoDB Logo MongoDB