WinRT ListView grouping on multiple levels - c#

I have a project where I have a list of appointments:
Appointment:
Name
City
Street
I want to display those in a ListView, and group them on 2 levels, first by city, and then by street. I also want to be able to collapse the items on both levels and style the header differently.
Is something like that possible in a ListView in WinRT?
I thought about using a ListView in a ListView. But that's not possible because I want to use single selection mode. Or is there some way I can enforce this?

Personally I would keep it simple.
In the Cineworld app I created, in cinema details xaml page, I give users options to view
* Films showing today (grouped by first char)
* Films grouped by date
* All films listed (grouped by first char).
These were all very different options and I settled on a combination of radio button and multiple grouped listview (within semantic zoom).
The solution has worked well so far.

Related

Toggle Listview filtered categories UWP

I am trying to create a UWP app where I have a classic Products class( Product(String Name, Sting category, String Quantity).
In my ViewModel I want them to be grouped based on the category as it is shown in this previous post I did.
I have tried many different possible ways to do this, nested ListViews, ListView grouping etc, the problem is that I want the collection of Products to be dynamic, so I don't know what categories I am going to have, and I also want to toggle the "category" when i click on it. The closest approach so far was using the ListView Grouping but i can't toggle the Category visibility this way. In WPF there were some approaches to achieve what I want by grouping but this doesn't work in UWP like this
If anyone could thing of an approach to achieve this, i would appreciate it! I am not asking for the implementation if it is hard, i mostly need the way to do this! Thank you for your time.
One option is to add all the items (including the categories and the products) into a single ObservableCollection and then to use TemplateSelector to display the categories and products differently in a ListView.
I've blogged about this option before, hopefully you find this useful: WinRT XAML GridView Performance Problems on Windows RT Tablets. This allows you quite much freedom as you can define any kind of a template for your category.
Another option is to use the built-in grouping functionality of ListView. Here's a step-by-step which should get you started: WinRT Step-by-Step Tutorial: MVVM + GridView + SemanticZoom

C# ListView items with custom controls

I'm maintaining a C# application written with windows forms. I now need to have a list view where every item has a few custom controls.
Every item need to have title and a combobox. The problem is that the data for the custom boxes will be different. So for example Item 1 could have a ComboBox where you can pick 1-3. Item 2 would have a combo box where you can pick 1-2.
So in the property column I need a string, and in the value column a combobox, with different data sets for different items (or at least for different kinds of items)
I've been on this problem for a while, and I don't really know where to go from here.
Why don't you use a Property Grid control? It is composed by two columns, the left one being a fixed text for the key/title and the right one is dynamic, in the sense you can have comboboxes, textboxes, color selection controls, etc. for the value the user can input/select.

Mark items in Listbox 2 from selection in ListBox 1

I have two ListBox with some items in each. I have three tables, lets say, company, employee, company_employee
I populate the first ListBox with the company, second ListBox with employee. What I want is to select a company and when I do that, select what employee's that are connected to that company.
How can I do this with asp.net MVC 4? I thought of a ajax-solution to get the records in company_employee depending on my first listbox selection id, but im not sure how to do this with asp.net.
Any suggestions to lead me forward?
Best regards,
me.
Use a jquery event triggered on a change of your first listbox that calls a webservice that will return a custom collection(employees) of type employee, this method will take in the country id perhaps . Bind that collection to a control. If you're expecting it all on a plate sorry but that is the way forward you can break this down and learn how to do each step.

Win8 Grid template how to hide all items from groupeditems page?

I'm new about win8 and developing visual studio.
I use Grid template and i wondering...
How to hide all items, but not Group name and group box.. I have too many items and i do want all item to this page. When click group box or title, find groupdetail page and there is all this group items?
Thanks.
The Grid template won't display all your items on the GroupedItemsPage. It uses the TopItems property in the view model to show at most 12 items. If you look in SampleDataSources.cs you'll see code (with a hard coded value - sigh) of 12 in ItemsCollectionChanged.
So, you could modify the 12 value if you want fewer, or if you want NO items to appear on the GroupedItemsPage, remove the GridView and perhaps replace it with a ListView whose ItemsSource is the group headers, but that's a bit more work and a change in the UI, which by all means is fine to do.
These templates are just a starting point, and we'd encourage you to make changes that make sense to provide the best user experience for your app.

Metro style: how to show filtering options for longlistbox in a proper way

I have a large collection of items with several parameters, so i'd like to give a user a possibility to have different filters: like order by time, by alphabet, or by categories.
How should i implement filter selection in Metro style? Should it be a menu items like this, but with "filter by alphabet" instead of "menuitem 1" ?
Edit:
Some more details: so, assume we have Movie items with 4 fields: name, year of release, genre and main actor's name. I'd like to allow user to set filtering by 1 of those 4 fields. Actually, it is not filtering or sorting, its more like categorizing.
Ok, i found this thing, looking quite nice.
Edit: though, be careful, it is not working the same as on the picture. At least, current version is not fading the screen, so other controls still would react on user input and Back button.
No way - the AppBar menu is not the way to go. For filtered content, you would normally use LongListSelector (both on WP7 and WP8). The filtering can be set by you when you group (or re-group) the items bound to the control - for the filter setter you could use any control (e.g. a auto-complete text input control or a ListPicker).

Categories

Resources