Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WP7 ListBox Grouping

Is there any in-built grouping for ListBoxes or another UI control? I would like to have a list but have some form of grouping or sections applied to the list. As shown below:

heading one
     list item one
     list item two
heading two
     list item one
     list item two
     list item three
     list item four

Is there anything available for such purpose without building something from scratch? I don't wish to mix a match multiple ListBoxes, rather I would prefer a solution where this was handled at the data binding level.

like image 764
Luke Avatar asked Nov 19 '10 14:11

Luke


2 Answers

LongListSelector comes to mind.

Using LongListSelector without LINQ - Andy Pennell's Blog

WP7 LongListSelector in depth | Part1: Visual structure and API | WindowsPhoneGeek

WP7 LongListSelector in depth | Part2: Data binding scenarios | WindowsPhoneGeek

Alternatively, you could look into applying either of these grouping implementations to the phone's listbox.

Confessions of a ListBox groupie [Using IValueConverter to create a grouped list of items simply and flexibly] - Delay's Blog

How to group items in a list by their first letter in Silverlight? - Stack Overflow

like image 110
Mick N Avatar answered Sep 22 '22 04:09

Mick N


You want to look at the "Long List Selector" in the Silverlight for Windows Phone Toolkit

Its a control that looks+behaves just like the grouping behavior in contacts/etc on the phone.

example image

like image 42
John Gardner Avatar answered Sep 22 '22 04:09

John Gardner