Results 1 to 2 of 2

Thread: Custom sort binding list?

  1. #1

    Thread Starter
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,388

    Custom sort binding list?

    Is it possible to custom sort a binding list by whatever I want?

    I want to sort by a nested property (not using the binding sources sort string thing, as it doesn't support these), and I don't really want to add a readonly property that returns what I want to the object, because out of the binding source it is kind of silly having this ... since I could just go X.location.name when not using a bindingsource anyway.

    Thanks,
    Kris

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,348

    Re: Custom sort binding list?

    The IBindingList and IBindingListView interfaces support sorting based on PropertyDescriptors. You would need your list to provide the appropriate PropertyDescriptor for the values you want to sort by. I'm not an expert in this area but you might be able to implement the ITypedList interface like the DataView class does to provide such sorting. You might take a look at the IBindingList and ITypedList implementations in the DataView class to see how it does it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width