GridData in windowsphone 8
Hello,I want to design an app to track expenses. I have a problem with display all transactions in one day. I want to do something like this:
May 25 $68.00
--------------------------------------------------------------
Food $25.00
Gift $25.00
Telephone $18.00
May 24 $43.00
--------------------------------------------------------------
Food $20.00
Hobbies $23.00
The problem is that I can only display each transaction on its own date (ex. Food $25 May 25). I don't know how to group all transactions in the same date.Does anyone have suggestion?
Thanks in advance.
Re: GridData in windowsphone 8
Try reading some about stackpanels, they might be what you are looking for :wink:
Re: GridData in windowsphone 8
Thank DBDev for replying.
I think I didn't explain clearly enough.
I have a class Transaction.cs which has properties (date, category, amount). I used ListBox (like griddata) to display all transactions in form of table.
As I mentionned in the first post, I can only display a single transaction like:
Food $20.00 May 24
Hobbies $23.00 May 24
So, I want to display all transactions in one date as I mentionned in the first post like this:
May 24
Food $20.00
Hobbies $23.00
Thanks.
Re: GridData in windowsphone 8
You could take advantage of the grouping capabilities of the LongListSelector control. The code for implementing grouping differs between Windows Phone 7 and Windows Phone 8. Either way, the process is basically the same: you have one big datastore and you first have to separate out everything into groups (choose a "primary key", in this case, the date), easily done by using LINQ (you need to make a "group" class though), and then you add the collection of groups as the ItemSource of the LongListSelector.
Re: GridData in windowsphone 8
Thanks a lot Catholic Tech Geek, that sounds like what I looked for.
Thanks again.:smile:
Re: GridData in windowsphone 8
And a good example of this in action (although with images but the grouping is basically the same principle) is on MSDN at:
PhotoHub - Windows Phone 8 XAML LongListSelector Grid Layout sample in C#, XAML for Visual Studio 2012