Sort based on user entered data

Sort based on user entered data

Old forum URL: forums.lhotka.net/forums/t/5984.aspx


ajj3085 posted on Friday, December 12, 2008

Hi,

I have two sets questions.  My use case is this; when editing a part, you can specify an unlimited number of locations it can be in.  Each location has a priority.  I'm going to allow the user to set this by setting a value, where the lower the value the higher the priority.  I'm not going to worry about whether or not the user enters the same number twice; that will be considered the same priority.

Question 1:  Rocky has indicated that SortedBindingList is effectively obsoleted by Linq, which is fine.  How do I setup the binding for the location collection?  The collection won't be sorted by the business layer, I expect the grid to keep this sorting.  Do I use linq?  Or does someone know how to make the XamDataGrid always sort by a particular column?  Should I even bother to sort, or just let the user do so?

Question 2:  I'd like to auto set the priority on new items added to the list; basically just set it to the number of items now in the collection.  Would I do this by overriding InsertItem in BLB?  Or is there some place better to do this?

Thanks
Andy

Copyright (c) Marimer LLC