-
Oct 6th, 2014, 10:37 PM
#1
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
-
Oct 7th, 2014, 12:28 AM
#2
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|