CSLA .NET

From Rockford Lhotka's Expert C# 2005 and VB 2005 Business Objects books

Welcome to CSLA .NET Sign in | Join | Help
in Search

FilteredBindingList.Clear()

Last post 06-05-2008, 2:34 PM by James_2JS. 4 replies.
Sort Posts: Previous Next
  •  05-19-2008, 3:18 AM 23645

    FilteredBindingList.Clear()

    Hi,

    Whilst debugging some of my code that wasn't working I found that FilteredBindingList.Clear() is implemented as follows:

    /// <summary>
    ///
    Clears the list.
    ///
    </summary>
    public void
    Clear()
    {
        _list.Clear();
    }

    This seems wrong to me, as it removes all entries from the list, and not just those in the filter.
    Should it not perform some conditional action with if (_filtered) in a similar vein to FilteredBindingList.Count???? e.g.

    /// <summary>
    ///
    Clears the list.
    ///
    </summary>
    public void
    Clear()
    {
        if
    (_filtered)
            for (int
    index = Count - 1; index >= 0; index--)
                RemoveAt(index);
        else
            _list.Clear();
    }

    Thanks for any feedback!

    James

  •  05-19-2008, 4:43 PM 23675 in reply to 23645

    Re: FilteredBindingList.Clear()

    Interesting - yes, you are probably correct, and this is probably a bug. I'll add it to the wish list.
    Rocky
  •  05-19-2008, 6:16 PM 23677 in reply to 23675

    Re: FilteredBindingList.Clear()

    Cool! Thanks for the quick feedback!!

    And also, a big thank you for all your efforts on this amazing framework!!

    Cheers,

    James

  •  05-27-2008, 4:23 PM 23810 in reply to 23677

    Re: FilteredBindingList.Clear()

    I have put the change into the code in svn for 3.5.1. If you get a chance, can you give it a try and see if it works as you expect?
    Rocky
  •  06-05-2008, 2:34 PM 24002 in reply to 23810

    Re: FilteredBindingList.Clear()

    Hi Rocky,

    Sorry for the delay in getting back to you... all looks good to me!

    Many thanks,

    James

View as RSS news feed in XML

Please contact Magenic for your .NET consulting and CSLA .NET mentoring needs.
Please consider making a donation to help support the ongoing development of CSLA .NET.

Make donation through PayPal - it's fast, free and secure!
Why donate?
Powered by Community Server, by Telligent Systems