locked
How to do a graceful on screen sort of a list bound to an WinJS.UI.IListDataSource Interface RRS feed

  • Question

  • I've got a grouped Grid (just like the grid sample in vs2012 project/new).  I've been following the example "Controls_ListViewWorkingWithDataSources" and the sort is the part that confuses me.  I totally understand and have working remove items, add items to end, add items to beginning and change items, but what I want to do is figure out a way to sort what I have up there with manually  moving everything or having to calculate where I need to put something.  That is, if I have blocks with titles "AA","BB","CC","DD" and I come along and want to insert a new block "BB1" between "BB" and "CC", is there a way I can insert without having to figure out where it belongs?

    I know this sounds simple but it gets more confusing with groups.  I have two groups and it's not obvious to me where things are in the different groups.  My keys come back as "1","2","3","4".

    I think this would be common for anyone inserting items into a list but don't see any examples of this.

    thanks


    Peter Kellner http://peterkellner.net Microsoft MVP • ASPInsider

    Tuesday, July 10, 2012 9:59 PM

Answers

  • Hi Peter,

    I don't understand what you are asking here.  Your background data needs to be sorted and then your list will be sorted.  Your grouping should accomdate that as well.

    Maybe I would understand better if you could phrase this as a question?

    -Jeff


    Jeff Sanders (MSFT)

    • Marked as answer by Peter Kellner Friday, July 13, 2012 12:54 PM
    Friday, July 13, 2012 11:40 AM
    Moderator

All replies

  • Hi

    Thanks for your valueble feedback,

    I will send your complaints to the dev team. 

    Thanks

    Friday, July 13, 2012 11:36 AM
  • Hi Peter,

    I don't understand what you are asking here.  Your background data needs to be sorted and then your list will be sorted.  Your grouping should accomdate that as well.

    Maybe I would understand better if you could phrase this as a question?

    -Jeff


    Jeff Sanders (MSFT)

    • Marked as answer by Peter Kellner Friday, July 13, 2012 12:54 PM
    Friday, July 13, 2012 11:40 AM
    Moderator
  • I figured out what I needed.  you are right that the grouping sorts itself when items are changed.

    Peter Kellner http://peterkellner.net Microsoft MVP • ASPInsider

    Friday, July 13, 2012 12:54 PM